Time Duration Formatter
Format a time duration every common way at once: verbose (2 hours, 15 minutes), short (2h 15m 30s), ISO 8601 (PT2H15M30S), clock (02:15:30), approximate, total milliseconds and seconds, plus a full days/hours/minutes/seconds breakdown. Enter the duration in seconds, milliseconds or clock format.
Input
How the duration below is expressed.
Total number of seconds (decimals allowed).
Output
| Unit | Value |
|---|---|
| No data yet | |
Guides
The Time Duration Formatter turns a single length of time into every format you might need — all at once. Paste a number of seconds, a number of milliseconds, or a clock value like 51:04:05, and it instantly shows the same duration written eight different ways, so you can copy whichever one your log file, spec, or subtitle track expects.
How to use it
- Pick an Input Mode: Seconds, Milliseconds, or Clock (
hh:mm:ss). - Type the duration into the Duration field. Decimals are allowed for seconds and milliseconds, and the clock field also accepts fractional seconds (
hh:mm:ss.mmm). - Read off — and copy — any of the formatted results below.
Everything runs live in your browser as you type; nothing is uploaded.
The formats it produces
- Verbose — human-readable, e.g.
2 hours, 15 minutes, 30 seconds. - Short — compact unit tags, e.g.
2h 15m 30s. - ISO 8601 duration — the machine-readable standard, e.g.
PT2H15M30S(orP1DT2H3M4.500Swhen there are days and fractional seconds). A zero duration isPT0S. - Clock —
hours:minutes:seconds, with whole days and years rolled up into the hours field, e.g.55:33:20. - Approximate — the single most significant unit, e.g.
about 2 hours. - Milliseconds and Total Seconds — the whole duration collapsed to one unit.
- Breakdown table — the duration decomposed into years, days, hours, minutes, seconds and milliseconds, with each unit correctly carried over (90 seconds becomes 1 minute 30 seconds, never
0h 0m 90s).
What counts as a "year" or a "day"?
Units are calendar-free and fixed: a day is exactly 24 hours and a year is exactly 365 days (31,536,000 seconds). There is no daylight-saving, leap-second or leap-year adjustment — this is a duration formatter, not a calendar date calculator, so the same input always gives the same output.
Why is the ISO 8601 output missing some letters?
ISO 8601 durations only include the units that are non-zero. PT2H really is two hours with no minutes or seconds; P2DT7H33M20S skips the year designator because there are no whole years. The P starts the period and the T separates the date part (years/days) from the time part (hours/minutes/seconds) — a duration of only seconds is written PT45S, with the T still present.
Can I format negative durations?
Yes. Prefix a clock value with - (or enter a negative number of seconds/milliseconds) and every format is prefixed with a minus sign, e.g. -2h 15m.
Common uses
Converting a video length in seconds to hh:mm:ss for subtitles, turning an API's millisecond timestamp difference into something readable, writing an ISO 8601 duration for a JSON or XML field, or just checking how many days a large second count actually works out to.