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

  1. Paste the date

    Paste the full value into Format a date. The +05:30 at the end means the time was written 5½ hours ahead of UTC.

    2026-10-30T14:05:00+05:30
  2. Read 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.

  3. Show it in your zone

    Choose your zone under Show in time zone. In Asia/Tokyo the same moment is 2026-10-30T17:35:00+09:00.

  4. 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.

Try it now

Common mistakes

Confusing P1M and PT1M
Without the T, M means months. With the T, it means minutes. PT1M is one minute.
Dropping the offset
If you cut off Z or +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: