Tools
ISO 8601 durations
How the format works
A duration starts with P, then years (Y), months (M), weeks (W) and days (D). A T switches to the time part: hours (H), minutes (M) and seconds (S). So P3M is three months and PT3M is three minutes. Amounts must come in that order, and only the smallest one may have a decimal part, as in PT1.5H. A leading minus sign is accepted, although it is an extension to the standard.
An interval joins two parts with a slash: a start and an end, a start and a duration, or a duration and an end. Dates without an offset are read as UTC here. Years and months are not a fixed length, so a duration containing them has no exact number of seconds until you give a start date; with one, months are added by the calendar and the end of a month is respected.
| Text | Meaning |
|---|---|
P1Y2M10DT2H30M | 1 year, 2 months, 10 days, 2 hours, 30 minutes |
PT36H | 36 hours |
P2W | 2 weeks |
PT0.5S | half a second |
2026-11-07T12:00:00Z/P7D | a week from a start |
2026-01-01/2026-03-01 | start and end |
To add time to a date without this notation, use the date calculator.