ISO 8601 Date & Duration Converter · Tutorial
How to read ISO 8601 dates and durations from an API
5 min readbeginnerUpdated
An API returns "start" as 2026-10-30T14:05:00+05:30 and "length" as P1Y2M10DT2H30M. This tutorial explains each part, converts the time to UTC and your own zone, and spells out the duration in plain English.
What you need
- The ISO 8601 Converter
- A date and duration from an API or file (the Try it button loads a sample)
Steps
Paste the date
Paste the full value into Format a date. The
+05:30at the end means the time was written 5½ hours ahead of UTC.2026-10-30T14:05:00+05:30Read it in UTC
The UTC row shows
2026-10-30T08:35:00Z, the same instant with the offset removed. Store and compare times in this form to avoid time zone bugs.Show it in your zone
Choose your zone under Show in time zone. In
Asia/Tokyothe same moment is2026-10-30T17:35:00+09:00.Decode the duration
Paste the duration under Read a duration. The tool reads it as 1 year, 2 months, 10 days, 2 hours and 30 minutes, about 37.6 million seconds.
P1Y2M10DT2H30M
Try it yourself
Opens the ISO 8601 Date & Duration Converter with this tutorial's sample loaded.
Common mistakes
- Confusing P1M and PT1M
- Without the T, M means months. With the T, it means minutes.
PT1Mis one minute. - Dropping the offset
- If you cut off
Zor+05:30, the time becomes ambiguous. The tool then assumes UTC and tells you so. - Comparing dates as text with different offsets
- Text sorting only works when all dates use the same offset. Convert to UTC first.
Next steps
Go back to the ISO 8601 Date & Duration Converter, or keep going with one of these: