← All Tools

ISO 8601 Duration Parser & Builder

Parse and build ISO 8601 durations like P1Y2M3DT4H5M6S. Enter components to build a duration, or paste a duration string to parse it into parts, total seconds, and a human-readable form.

Build

Date components

Time components

ISO 8601 output

PT0S

Note: weeks (W) cannot combine with other components per RFC 3339 / ISO 8601. If weeks is non-zero, all other fields are ignored in output.

Parse

Signed durations (-PT5M) and fractional seconds (PT1.5S) are supported.

Components

Totals (approximate)

Add duration to a date

Uses calendar-aware arithmetic: years and months advance by real calendar months (e.g. Jan 31 + P1M → Feb 28/29).

Result

Reference

ISO 8601 duration format: P[n]Y[n]M[n]DT[n]H[n]M[n]SP is required, T separates date and time parts. Example: PT1H30M = 1 hour 30 minutes. Week form P[n]W is exclusive.

Common uses: Cache-Control max-age analogs, Kubernetes pod lifecycle, JSR-310 Duration, JavaScript Temporal.Duration, and config files.

Copied!