✓tick.pro

ISO 8601 Duration Parser & Generator — P1DT2H30M | tick.pro

Parse and generate ISO 8601 duration strings (PnYnMnDTnHnMnS and PnW). Explain components and total seconds, or build a duration from years, months, weeks, days, hours, minutes, and seconds.

Parse an ISO 8601 duration

Enter a duration string (PnYnMnDTnHnMnS or PnW) to see its components, normalized form, and total seconds.

Generate an ISO 8601 duration

Build a duration from components. Weeks (PnW) cannot be combined with other components. A fractional value is valid only in the smallest present component.

Format Reference

Duration
PnYnMnDTnHnMnS
Week form
PnW (cannot be combined with other components)
Examples:
P1Y = 1 year
P3M = 3 months
P2W = 2 weeks
P1DT2H = 1 day, 2 hours
PT30M = 30 minutes
PT1.5S = 1.5 seconds (fraction only in smallest component)

Frequently Asked Questions

What is an ISO 8601 duration?

ISO 8601 durations represent time spans using the format PnYnMnDTnHnMnS (and the week form PnW). For example, P1DT2H means 1 day and 2 hours, and P2W means 2 weeks. The T separates date components from time components.

Can I generate an ISO 8601 duration?

Yes. Enter component values (years, months, weeks, days, hours, minutes, seconds) to generate a normalized duration string. The week designator (PnW) cannot be combined with other components; a fractional value is valid only in the smallest present component.

Where are ISO 8601 durations used?

Google APIs, XML schemas, .NET TimeSpan, Luxon, and many scheduling systems use ISO 8601 durations. They are a standard way to express time spans in machine-readable format.

curl "https://tick.pro/formats/iso-duration?input=P1DT2H30M"