Skip to content

Latest commit

 

History

History
55 lines (51 loc) · 1 KB

19-as-iso-string.md

File metadata and controls

55 lines (51 loc) · 1 KB
title version signature
As ISO 8601 String
2.8.0
moment.duration().toISOString();

Returns duration in string as specified by ISO 8601 standard.

moment.duration(1, 'd').toISOString() // "P1D"

Format PnYnMnDTnHnMnS description:

Unit Meaning
P _P_ stands for period. Placed at the start of the duration representation.
Y Year
M Month
D Day
T Designator that precedes the time components.
H Hour
M Minute
S Second