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
- Compact —
1d 1h 1m 1s. For logs, dashboards and anywhere space is tight. Zero components are dropped, so five minutes reads as5mrather than0d 0h 5m 0s. - Clock —
25: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. - Words —
1 day, 1 hour, 1 minute, 1 second. For prose and email, with singular and plural handled. - ISO 8601 —
P1DT1H1M1S. 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.
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.
