ISO 8601 Duration Parser
Parse an ISO 8601 duration (P1Y2M3DT4H5M6S, PT90M, P2W), a clock time or plain words into parts, totals and the other notations, and add it to a start instant.
The duration’s parts, its ISO, clock and plain-English forms, totals in seconds/minutes/hours/days (with the year/month assumption flagged), and the end instant from a start you give.
Example: P1Y2M3DT4H5M6.5S is 1 year 2 months 3 days 4 hours 5 minutes 6.5 seconds; from 2026-01-31 it ends 2027-04-03T04:05:06.5Z. "2 days 4 hours and 30 min" is P2DT4H30M = 189,000 s.
Nominal durations,
with the assumptions named.
The grammar accepted, why years and months need an assumption, and how adding to a date works.
Grammar
ISO 8601 durations are P followed by years, months, weeks, days and, after T, hours, minutes, seconds — each optional, a decimal fraction allowed only on the smallest one, an optional leading sign. Clock notation (1:30:00) and plain words (2 days 4 hours) are also read and written back as ISO.
Totals
Seconds, minutes, hours and days have fixed lengths; years and months do not. When they appear the totals assume 365-day years and 30-day months and say so. The "add to a start" result avoids the assumption: it moves the calendar by the months and years first (clamping the day if the target month is shorter), then adds days and the time part.
Nominal, not elapsed
A duration is nominal: P1D is one calendar day even across a daylight-saving change. The page works in UTC and does no zone arithmetic. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.
SOURCES
- ISO 8601-1:2019 §5.5.2 duration representation PnYnMnDTnHnMnS and PnW, decimal fraction on the lowest-order component; RFC 3339 Appendix A grammar
Last reviewed 20 September 2026. How results are checked: How we verify.