Developer Tool

ISO 8601 Duration Parser & Builder

ISO 8601 durations look like P3Y6M4DT12H30M5S — paste one to see it in plain English, or build one from individual units below.

Enter a duration string
Enter at least one unit

Where you'll run into this format

ISO 8601 durations show up in iCalendar (DURATION: fields), many REST APIs (subscription periods, token lifetimes, retry intervals), and XML Schema's duration type. The format is: P, then years/months/days, then — if there's a time component — T followed by hours/minutes/seconds. The T is what disambiguates months from minutes, since both use the letter M.

The one genuine ambiguity: months

A duration in years, months, or weeks doesn't correspond to an exact number of seconds the way hours, minutes, and seconds do — a month can be 28 to 31 days. This tool converts using calendar-average lengths (30.44 days/month, 365.2425 days/year) for its total-duration estimate, which is the standard convention, but be aware it's an average, not an exact count for any specific calendar month.

Related

Related tools