Skip to tool
ecech.
🕑 Date, Time & Timezone

Seconds to a Duration People Can Read, in Both Directions

90061 seconds is 1d 1h 1m 1s. Paste a number to format it, or type a duration to get seconds back — with the zero components dropped.

Formats

In minutes

In hours

In days

In weeks


Advertisement

How the calculation works

300 seconds, formatted two ways keeps every unit 0d 0h 5m 0s four numbers, one of them useful drops the zeroes 5m the same information A duration is read by a person. Padding it with zeroes makes them do the filtering.

How to Use This Tool

Type a number of seconds to see it in every common format, or type a duration in words to get the seconds back. Both directions work at once.

Which format for which job

  • Compact1d 1h 1m 1s. For logs, dashboards and anywhere space is tight. Zero components are dropped, so five minutes reads as 5m rather than 0d 0h 5m 0s.
  • Clock25:01:01. For media players and stopwatches. Note that hours accumulate past 24 rather than rolling over, because a duration is not a time of day.
  • Words1 day, 1 hour, 1 minute, 1 second. For prose and email, with singular and plural handled.
  • ISO 8601P1DT1H1M1S. For APIs that expect it, such as the YouTube Data API.

Why it stops at days

You will notice there is no "months" output. That is deliberate. A month is 28, 29, 30 or 31 days, so converting a fixed number of seconds into months requires picking an average — usually 30 days or 30.44 — and the result is then wrong for every actual month.

Printing "1.2 months" gives an answer that looks precise and is not, and people quote it as though it were. Weeks are included because a week is exactly seven days everywhere, always. Days are included with the caveat below.

"A day" is 86,400 seconds, except twice a year Normal day 86,400 s 24 hours Clocks spring forward 82,800 s 23 hours — an hour is skipped Clocks fall back 90,000 s 25 hours — an hour repeats Fine for elapsed time. Not fine for "same time tomorrow".
Elapsed seconds and calendar days are different things on two days each year.

Rounding, and where to do it

Fractional seconds are handled by rounding once at the end rather than flooring each unit in turn. Flooring in sequence is what produces output like 0m 59s for 59.6 seconds — technically each step is correct and the result is worse than either sensible answer. If you need the fraction preserved, it appears in the seconds component rather than being silently discarded.

Parsing written durations

The second box accepts most of the ways people write durations: 2h30m, 2h 30m, 90 min, 1.5 hours, 1d4h. Units may be abbreviated or spelled out, spacing does not matter, and components can appear in any order. What it will not do is guess: a bare number with no unit is read as seconds and it says so, rather than assuming minutes because that seemed likely.

Advertisement

Frequently Asked Questions

How many seconds are in a day?
86,400 on a normal day. On the two days a year when clocks change for daylight saving it is 82,800 or 90,000, because an hour is skipped or repeated. For measuring elapsed time 86,400 is the right constant; for 'the same time tomorrow' it is not, which is why calendar arithmetic and duration arithmetic are different jobs.
Why doesn't this convert seconds to months?
Because a month is 28, 29, 30 or 31 days, so there is no fixed number of seconds in one. Converting would mean picking an average and producing a figure that looks precise and is wrong for every real month. Weeks are included because a week is exactly seven days everywhere, always.
What is the difference between 25:01:01 and 1:01:01?
The first is a duration of twenty-five hours; the second is either one hour or a time of day. Durations accumulate hours past 24 rather than rolling over, because there is no midnight in an elapsed measurement. A formatter that wraps at 24 is treating your duration as a clock time.
How do I convert seconds to hh:mm:ss?
Divide by 3600 for whole hours, take the remainder and divide by 60 for minutes, and the remainder of that is seconds — then pad minutes and seconds to two digits. The clock row above shows this, and it does not wrap at 24 hours.
What does P1DT1H1M1S mean?
It is the same duration written in ISO 8601: one day, one hour, one minute and one second. The P marks a duration and the T separates the date part from the time part. The YouTube Data API and several other systems use this format for lengths.
Can I type a duration and get seconds back?
Yes, in the second box. It accepts 2h30m, 2h 30m, 90 min, 1.5 hours and similar, in any order and with or without spaces. A bare number with no unit is treated as seconds and flagged, rather than assumed to be minutes.

Related tools in Date, Time & Timezone

Browse all Date, Time & Timezone tools
The Mac mini the ecech. site is built on, beside a handwritten note reading ecech.com.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.