I wanted to check if momentjs
is able to convert a given number of seconds to a ISO 8601 formatted duration string.
E.g. 1000 seconds will lead to PT16M40S
.
You can use toISOString
on the duration:
moment.duration(1000, 'seconds').toISOString() //"PT16M40S"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With