Converting to ISO 8601 standard duration format
See original GitHub issueHi 👋🏼,
First of all, thank you for this great library 😃
I couldn’t find a way to convert the minutes or hours to ISO 8601 duration format. For example:
With moment.js I can do;
moment.duration(30, 'minutes').toISOString();
// output: PT30M
moment.duration(70, 'minutes').toISOString();
// output: PT1H10M
Couldn’t find a way to do the same thing in dayjs.
Any suggestions?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Temporal.Duration - TC39
Briefly, the ISO 8601 notation consists of a P character, followed by years, months, weeks, and days, followed by a T character, followed...
Read more >How to parse ISO 8601 duration strings in JavaScript - Twilio
This format displays a duration in the following format: PnYnMnDTnHnMnS where n is the number for the corresponding interval: Y = years; M...
Read more >Time Duration Calculator - 345Tool.com
Time Duration Calculator · 60 Minutes · 1 Hours · 0.0416667 Days · 0.0013889 Months · 0.0001142 Years ...
Read more >What is the value of the ISO 8601 duration `P1M` (in seconds)?
For 30-day months, it might be 2,592,000. For 31-day months, it might be 2,678,400. In February, it might be 2,419,200 or it might...
Read more >Format time period links - ISO Codes - Workiva Support
Time period, ISO 8601 format ; Three years six months (or 3 years 6 months), P3Y6M ; 21 days or twenty-one days, P21D ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mariomc Thanks mate. But it looks like it does the opposite thing for what I need.
#564 todo: Duration plugin