⏳ ISO 8601 Duration Converter

ISO 8601 duration stringP1DT2H30M

Specify years, months, days, hours, minutes, and seconds to build an ISO 8601 duration string (e.g. P3Y6M4DT12H30M5S), or parse an existing ISO 8601 duration string back into its component parts. Useful for checking durations used in API responses and config files.

How to use

  1. Choose "build" or "parse" mode.
  2. In build mode, enter years/months/days/hours/minutes/seconds; in parse mode, enter an ISO 8601 duration string.
  3. The result is shown automatically.

FAQ

What is an ISO 8601 duration string?

An international standard notation starting with "P", followed by years (Y), months (M), and days (D), then a "T" separator followed by hours (H), minutes (M), and seconds (S). For example, "P3Y6M4DT12H30M5S" means 3 years, 6 months, 4 days, 12 hours, 30 minutes, and 5 seconds.

How is total seconds calculated?

It approximates a month as 30.44 days (365.25 ÷ 12) and a year as 365.25 days. Since calendar months and leap years vary in length, this is only an approximation.

Where is this format used?

REST API responses, iCalendar files, the XML Schema duration type, and many other standards and config formats use this notation for durations.