Duration to Seconds

Convert an ISO 8601 duration — like PT1H30M or P1DT6H — into total seconds, with a clean hours-minutes-seconds breakdown.

ISO 8601 duration
Result
 

Reading ISO 8601 durations

An ISO 8601 duration starts with P and uses Years, Months, Weeks and Days, then a T before the time part with Hours, Minutes and Seconds. For example PT1H30M is one hour thirty minutes (5,400 seconds) and P1DT6H is one day six hours.

Years and months use average lengths (365.2425 and 30.44 days) since they have no fixed second count; days, hours, minutes and seconds are exact.

Frequently asked questions

What does PT1H30M mean?

It is an ISO 8601 duration: P starts it, T separates the time part, so this is 1 hour and 30 minutes — 5,400 seconds.

How are months and years counted?

They use average lengths (a year of 365.2425 days, a month of about 30.44 days), because calendar months and years vary in length.

What is the T for?

The T separates the date part (years, months, weeks, days) from the time part (hours, minutes, seconds). PT1H is one hour; P1D is one day.

Related tools