Time duration converter

Convert milliseconds, seconds, minutes, hours, days, weeks, months and years, turn seconds into a readable duration, or type 1d 2h 3m and get seconds.

loading Time duration converter
About this tool

What is a time duration converter?

A time duration converter changes a length of time from one unit into another: milliseconds, seconds, minutes, hours, days, weeks, months and years. Type 90 minutes and see 1.5 hours; type 2 weeks and see 336 hours; turn 1,500 milliseconds into 1.5 seconds. It has three modes. Convert units shows a value in every unit at once. Readable duration turns a number of seconds into words and a compact form (93,784 seconds becomes "1 day, 2 hours, 3 minutes, 4 seconds" or 1d 2h 3m 4s). Text to seconds does the reverse: type 1d 2h 3m and get the number of seconds.

Developers use it for timeouts, cache lifetimes (TTL), token expiry, retry delays, benchmark results and log analysis; people use it for project estimates, video lengths, recipe timings and anything where "how many hours is 5,400 seconds?" comes up. The text mode accepts several notations: units such as ms, s, m, h, d, w, mo and y or whole words like "hours", the clock form 1:30:00 (h:mm:ss) and the ISO 8601 duration format such as PT1H30M.

One caveat matters for months and years: they are not fixed lengths. The tool uses the astronomical averages, a month of 30.436875 days and a year of 365.2425 days (the mean Gregorian year), and labels them as averages. For real calendar months and years, with their different lengths and leap years, use the date calculator. Everything runs in your browser.

How to convert a duration

  1. Choose the mode: convert units, readable duration or text to seconds.
  2. In convert units, type a value and pick its unit. The table lists the same duration in every unit; click a row to copy it.
  3. In readable duration, type a number of seconds to see it in words and in compact form, ready to copy.
  4. In text to seconds, type a duration such as 1d 2h 3m, 2 hours 15 minutes, 1:30:00 or PT1H30M and read the total in seconds.
  5. If the text cannot be read, the message names the part it could not understand so you can fix it.

Examples

Minutes to hours

90 minutes = 1.5 hours. 2 weeks = 336 hours. 1 day = 86,400 seconds. 1,500 milliseconds = 1.5 seconds.

Readable duration

93,784 seconds is 1 day, 2 hours, 3 minutes, 4 seconds, or 1d 2h 3m 4s in compact form. 3,661 seconds is 1 hour, 1 minute, 1 second (1h 1m 1s).

Text to seconds

1d 2h 3m = 93,780 seconds. 2 hours 15 minutes = 8,100 seconds. 1:30:00 and PT1H30M both equal 5,400 seconds. 1w 2d = 777,600 seconds.

Average months and years

1 year = 365.2425 days and 1 month = 30.436875 days. They are averages, not calendar months.

A cache TTL

A TTL of 86,400 seconds is exactly one day; 604,800 seconds is one week; 3,600 seconds is one hour.

Common mistakes

  • Using 30 days for a month and 365 days for a year. Real months vary from 28 to 31 days and years have 365 or 366. Use the date calculator for dates; the converter's values are averages.
  • Mixing m for minutes and months. In the text mode, m is minutes and mo is months.
  • Negative durations. A duration cannot be negative; the tool asks for 0 or more.
  • Typos in the text. 1d2hours3 is not readable; write a number followed by a unit for each part: 1d 2h 3m.
  • Confusing seconds and milliseconds in timeouts. Many APIs and libraries expect milliseconds. 5 seconds is 5,000 ms.
  • Treating days as always 24 hours. In zones with daylight saving time a calendar day can be 23 or 25 hours; durations here are fixed 24-hour days.

Frequently asked questions

How many seconds are in a day?

86,400 (24 × 60 × 60).

How do I convert seconds to hours, minutes and seconds?

Divide by 3,600 for the hours, take the remainder and divide by 60 for the minutes; what is left is the seconds. 3,661 s is 1 h 1 min 1 s.

How do I convert minutes to decimal hours?

Divide by 60. 45 minutes is 0.75 hours. For worked time with breaks, see the hours calculator.

What does PT1H30M mean?

It is an ISO 8601 duration: a period (P) of time (T) of 1 hour and 30 minutes.

What other time tools are there?

The date converter for timestamps, the chronometer to measure time and the ETA calculator to estimate how long a job will take.

Report a problem