ISO 8601 Duration Parser|PnYnMnDTnHnMnS to Seconds, Minutes, Hours
Paste an ISO 8601 duration like P1Y6M14DT12H30M45S, PT1H30M or the week form P1W and get total seconds, milliseconds, minutes and hours at once. Each Y/M/D/H/M/S component is split out alongside a human-readable line.
💡 About this tool
If you live in cron schedulers, Kubernetes liveness probes, OpenAPI format: duration fields or RFC 3339 APIs, strings like PT30M and P3DT4H show up constantly. You can read them fine — but "okay, how many seconds is that actually?" is annoying to do in your head, and it's easy to fumble the Y/M/D unit boundaries and end up an order of magnitude off.
This parser takes the raw string and shows total seconds, milliseconds, minutes and hours in four cards simultaneously. It also breaks the value into its six Y·M·D·H·M·S components so you can see the ISO 8601 structure directly — everything before T is the date part, everything after is the time part. For durations that span months or years, you can flip the "days per year" basis between 365, 365.25 and 366 to compare a leap-aware estimate against a plain 365-day one side by side.
🧐 Frequently Asked Questions
Q. How many seconds is P1Y ("one year")?
It depends on the days-per-year basis you pick: 31,536,000 s at 365 days, 31,557,600 s at 365.25. Months are approximated as one year divided by twelve.
Q. Why are years and months "approximate"? ISO 8601 durations are nominal and calendar-independent — a real month is anywhere from 28 to 31 days. If you need an exact delta from a specific start date, you need calendar arithmetic, not a fixed-length conversion.
Q. Does the week form P1W work?
Yes. P1W converts as 7 days = 604,800 seconds. The week form must stand alone, though — you can't mix it with other designators like P1Y2W.
Q. Can I enter decimals?
Yes. Values with a decimal point (or comma) such as PT1.5H or PT0.5S are parsed.
Q. Are negative durations (-PT1H) supported?
No. A string that starts with a minus sign is rejected as an error here.
Q. What happens if I forget the T?
P1M means one month; PT1M means one minute. M is months in the date part and minutes in the time part, so if you mean minutes, always put it after T.
📚 Quirks of ISO 8601 duration notation
ISO 8601 durations start with P (for Period) because they describe a length, not a moment in time. The T separates the time part, and without it M is ambiguous — that single character is exactly why P1M and PT1M mean completely different things.
In practice you hit this format more often than you'd expect: timeout configs, retry intervals, and media metadata all lean on it. The YouTube Data API, for instance, returns contentDetails.duration as strings like PT4M13S. Whether you write "30 minutes" as PT30M or PT0.5H is up to you, but most teams keep things integer and use the smallest natural unit for machine-friendliness. When a third-party tool hands you a duration string in a config file, converting it to plain seconds in one shot is the fastest way to sanity-check the value before it goes live.