Guide
ISO 8601 durations: reading, adding and measuring them
When an API says a video lasts PT4M13S, a subscription renews every P1M and a token expires after PT15M, it is using the duration notation of ISO 8601. The format is compact and exact about what is meant, but it is easy to misread, and it hides a real subtlety: a month is not a fixed number of days. This page reads durations in plain words, adds them to dates, and measures the span between dates.
The grammar
A duration starts with the letter P for period. Next come the date components in a fixed order, each a number and a letter: Y for years, M for months, W for weeks and D for days. If the duration has a time part, the letter T comes next, followed by H for hours, M for minutes and S for seconds. So P1Y2M10DT2H30M is one year, two months, ten days, two hours and thirty minutes. The smallest unit may have a decimal fraction, as in PT0.5S, and a leading minus sign is accepted as an extension.
Reading a duration
Enter a duration and the page shows it in words, in its canonical form, and the length of its exact parts in seconds. Weeks, days, hours, minutes and seconds have fixed lengths, so they can be added up. Years and months cannot be, because a month may be 28 to 31 days and a year 365 or 366, so the page says so instead of inventing a number. A second line carries seconds into minutes, hours and days, and never into months or years.
Adding a duration to a date
Pick “Add it to a date”, enter the start, and the result is the date afterwards. The calculation is in UTC. Years and months are added first by moving the calendar: adding P1M to 31 January 2026 gives 28 February 2026, because February has no 31st and the day is clamped to the last day of the month; in 2028, a leap year, the answer is 29 February. After that the exact parts, weeks, days and time, are added on top.
Duration between two dates
“Duration between two dates” takes the earlier date and counts the whole months that fit, then the remaining days and time of day. This is the method of Java’s Period and of the Temporal proposal for JavaScript, and it gives results people expect: from 29 February 2020 to 30 October 2026 at 14:05:09 UTC it reports P6Y8M1DT14H5M9S. The page also gives the total days and seconds, which are exact because they ignore the calendar.
A worked example
The Sample button loads P1Y2M10DT2H30M. In words: 1 year, 2 months, 10 days, 2 hours, 30 minutes. The exact parts, 10 days and 2.5 hours, come to 873,000 seconds, and the page notes that years and months have no fixed length. Other inputs behave as follows: PT36H reads as 36 hours (it is not converted to 1 day 12 hours in the canonical form), and P1M added to 31 January 2026 gives 28 February 2026.
Limits
All dates are handled in UTC, so daylight-saving changes in a local zone are not applied: adding P1D to a local date across a clock change adds 24 hours here, which may not match a calendar library. The notation for durations with a sign and for repeating intervals (R5/PT1H) is not fully covered. Only the format is checked; the page does not know what a duration is for or whether a service accepts it.
Related tools
- Timestamp Converter converts Unix times and ISO strings.
- RFC 3339 Converter rewrites a date in many formats.
- strftime Builder formats dates with percent patterns.
- Cron Expression Parser describes recurring schedules.
Checked against the current version of the ISO 8601 Duration Calculator on .

