ISO 8601 Duration Converter
Paste an ISO 8601 duration such as PT1H30M, P1Y2M3DT4H5M6S or P2W (as seen in the YouTube API, OpenAPI and iCalendar) to get the total in seconds, minutes, hours and days, plus a breakdown by component. You can also turn a number of seconds into a duration string, or add a duration to a date. Everything happens in your browser, and nothing you type is sent to a server. For epoch times, see the Unix Timestamp Converter.
🔒 Runs in your browser · Your data is never sent to a server
ISO 8601 duration → seconds, minutes, hours
- Breakdown
- Total (seconds)
- Total (minutes)
- Total (hours)
- Total (days)
Seconds → ISO 8601 duration
- ISO 8601 duration
- Breakdown
Add the duration to a date
Adds (or subtracts) the value from the ISO 8601 duration field above to the start date, following the calendar.
- Resulting date/time
- -
Notes
- Years and months do not have a fixed length, so converting them to seconds, minutes, hours or days is only an estimate (1 year = 365.2425 days, 1 month = one twelfth of that). For an exact result, use the date addition section instead.
- A week (W) counts as 7 days. The standard says weeks should not be combined with other units, but this tool also reads forms such as P1W2D.
- The standard puts a decimal only on the smallest unit, but this tool accepts decimals (dot or comma) on any unit.
- A day is treated as 24 hours (86,400 seconds). Daylight saving changes are not taken into account when converting to seconds.
- Letters can be upper or lower case. A leading minus sign makes the duration negative.
Glossary
ISO 8601 duration
A format that starts with P, followed by years (Y), months (M), weeks (W) and days (D), then a T and hours (H), minutes (M) and seconds (S). PT1H30M means 1 hour 30 minutes, and P1Y2M3D means 1 year 2 months 3 days.
T (time designator)
The letter that separates date units from time units. Because M means both month and minute, P1M is one month and PT1M is one minute.
iCalendar DURATION
The duration notation used for calendar alarms (VALARM) and similar properties. A negative value such as -PT15M means 15 minutes before.
FAQ
What is the difference between the M in PT1H30M and in P1M?
An M before the T means months, and an M after the T means minutes. P1M is one month and PT1M is one minute. Always put a T before hours, minutes and seconds.
Why are the totals for durations with years or months approximate?
A month can be 28 to 31 days and a year 365 or 366, so their length is not fixed. This tool uses 1 year = 365.2425 days and 1 month = one twelfth of that. For an exact date, use the date addition section, which follows the calendar.
Can I combine weeks and days, like P1W2D?
In the basic ISO 8601 format, weeks (W) are meant to stand alone, but this tool also reads combinations and counts a week as 7 days. Other systems may reject them, so use days only when passing a duration elsewhere.
Are fractional seconds like PT0.5S and negative durations supported?
Yes. Decimals can use a dot or a comma. A leading minus, as in -PT15M (used for iCalendar alarms), makes the duration negative.
Share this page
