Code tool

ISO 8601 Duration Parser

Parse PnDTnHnMnS durations with fixed elapsed-time units.

In-browser processingNo account requiredPrivacy details ↗

Y (years), M before T (calendar months), and weeks are rejected because they need calendar semantics.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter a duration.
  2. Parse it locally.
  3. Review the component values.

Explicit subset

Accepts PnD, PTnH, PTnM, and PTnS in ISO order, with an optional decimal on days or seconds. Hours and minutes are 0–23 and 0–59; seconds are below 60.

Calendar units excluded

Years, calendar months, and weeks are rejected because their elapsed length depends on a calendar or a chosen convention; they are never treated as fixed seconds.

GOOD TO KNOW

Common questions

Are years or months converted?

No. Their duration depends on calendar context, so this local tool rejects them.