← Hashito System home 日本語 Tools Blog
Parse an ISO 8601 duration
Build an ISO 8601 duration

How ISO 8601 durations are written

What does PT1H30M mean?

P starts the duration and T starts the time part. After T, H is hours, M is minutes and S is seconds. PT1H30M is one hour thirty minutes, or 5400 seconds.

M means different things before and after T

Before T, M is months. After T, M is minutes. P1M is one month and PT1M is one minute, which are completely different lengths. This is the most common mistake.

W (weeks) and D (days) can appear together

You can write P1W3D to mean one week and three days. A week counts as seven days, and this tool follows the same rule.

Durations with years or months cannot be resolved to exact seconds

Whether a year is 365 or 366 days, and whether a month is 28 to 31 days, depends on the start date. For input containing Y or M this tool reports an estimate using 365 days per year and 30 days per month, and says so under the result.

Frequently asked questions (FAQ)

How many seconds is PT1H30M?

5400 seconds. One hour is 3600 seconds and thirty minutes is 1800 seconds.

What is the difference between P1M and PT1M?

P1M is one month and PT1M is one minute. M before T means months and M after T means minutes.

Which notation should I use for structured data?

VideoObject duration and Recipe cookTime take an ISO 8601 duration. The time-only form such as PT1H30M is the usual choice. The "Hours only" output of this tool can be pasted directly.

Is my input sent to a server?

No. All conversion runs in your browser. Your input is never sent to or stored on a server.