1. Home
  2. Developer tools
  3. ISO 8601 Duration Calculator

ISO 8601 Duration Calculator

ISO 8601 durations such as PT36H or P1Y2M10D appear in video metadata, calendars, APIs and Java and .NET code. Paste one to see it in words, add it to a date, or get the duration between two dates.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use ISO 8601 Duration Calculator

  1. Choose read, add or between.
  2. Enter the duration and dates.
  3. Read the result in words and ISO form.

Features

  • Parses years, months, weeks, days, hours, minutes and fractional seconds
  • Plain-language description and canonical form
  • Adds a duration to a date in UTC with month-end clamping
  • Duration between two dates, whole months first
  • Seconds for the exact parts
  • Clear errors for invalid designators

Supported formats

Input

  • ISO 8601 duration
  • Dates

You get

  • Plain words
  • Date
  • Duration

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the ISO 8601 Duration Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • All dates are calculated in UTC; daylight-saving changes in local time are not applied.
  • A negative duration with a leading minus sign is an extension that not every library accepts.

Guide

ISO 8601 durations: reading, adding and measuring them

When an API says a video lasts PT4M13S, a subscription renews every P1M and a token expires after PT15M, it is using the duration notation of ISO 8601. The format is compact and exact about what is meant, but it is easy to misread, and it hides a real subtlety: a month is not a fixed number of days. This page reads durations in plain words, adds them to dates, and measures the span between dates.

The grammar

A duration starts with the letter P for period. Next come the date components in a fixed order, each a number and a letter: Y for years, M for months, W for weeks and D for days. If the duration has a time part, the letter T comes next, followed by H for hours, M for minutes and S for seconds. So P1Y2M10DT2H30M is one year, two months, ten days, two hours and thirty minutes. The smallest unit may have a decimal fraction, as in PT0.5S, and a leading minus sign is accepted as an extension.

Reading a duration

Enter a duration and the page shows it in words, in its canonical form, and the length of its exact parts in seconds. Weeks, days, hours, minutes and seconds have fixed lengths, so they can be added up. Years and months cannot be, because a month may be 28 to 31 days and a year 365 or 366, so the page says so instead of inventing a number. A second line carries seconds into minutes, hours and days, and never into months or years.

Adding a duration to a date

Pick “Add it to a date”, enter the start, and the result is the date afterwards. The calculation is in UTC. Years and months are added first by moving the calendar: adding P1M to 31 January 2026 gives 28 February 2026, because February has no 31st and the day is clamped to the last day of the month; in 2028, a leap year, the answer is 29 February. After that the exact parts, weeks, days and time, are added on top.

Duration between two dates

“Duration between two dates” takes the earlier date and counts the whole months that fit, then the remaining days and time of day. This is the method of Java’s Period and of the Temporal proposal for JavaScript, and it gives results people expect: from 29 February 2020 to 30 October 2026 at 14:05:09 UTC it reports P6Y8M1DT14H5M9S. The page also gives the total days and seconds, which are exact because they ignore the calendar.

A worked example

The Sample button loads P1Y2M10DT2H30M. In words: 1 year, 2 months, 10 days, 2 hours, 30 minutes. The exact parts, 10 days and 2.5 hours, come to 873,000 seconds, and the page notes that years and months have no fixed length. Other inputs behave as follows: PT36H reads as 36 hours (it is not converted to 1 day 12 hours in the canonical form), and P1M added to 31 January 2026 gives 28 February 2026.

Limits

All dates are handled in UTC, so daylight-saving changes in a local zone are not applied: adding P1D to a local date across a clock change adds 24 hours here, which may not match a calendar library. The notation for durations with a sign and for repeating intervals (R5/PT1H) is not fully covered. Only the format is checked; the page does not know what a duration is for or whether a service accepts it.

Checked against the current version of the ISO 8601 Duration Calculator on .

Frequently asked questions

What is the difference between PT1M and P1M?

The T matters. PT1M is one minute, because the M comes after the T in the time part. P1M is one month. Forgetting the T is the most common mistake when writing durations by hand, and it turns a minute into about thirty days.

Why is there no way to say a duration of 90 minutes as P1H30M?

Hours, minutes and seconds belong after the T, so 90 minutes is PT90M or PT1H30M. The date part before the T takes only years, months, weeks and days.

What is 31 January plus one month?

28 February in 2026, or 29 in a leap year. The day is clamped to the last day of the shorter month rather than overflowing into March.

Why are years and months not turned into seconds?

A month can be 28 to 31 days and a year 365 or 366, so there is no single correct number of seconds. Only the parts with a fixed length are converted.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.