As ISO 8601 String2.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 |
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .