Your files stay on your device

ISO 8601 duration parser and formatter

Read and write ISO 8601 durations like P1DT2H.

Direction

P1W · PT30M · -PT90.5S: fractions only on the lowest component, weeks stand alone.

How this test works
  • ISO 8601-1 grammar: weeks are exclusive (P1W, never P1Y2W), fractions only on the lowest-order component, comma or dot as the separator.
  • Days and weeks are fixed elapsed time (1 d = 24 h, 1 w = 7 d). Those totals are exact.
  • Years and months stay components: no exact millisecond total exists for them, and none is fabricated here.
  • Sub-millisecond fractions are truncated, never rounded into the next second.
Paste, drop, or type to begin. Everything stays on this device.