RunTheTests
/

Time Duration Calculator

Work out the time between two dates or times.

What you provide

Result

1d 8h 30m

The duration between the two moments, regardless of order. Parsing follows your locale for bare dates; add a time and it is used too.

Diagnostic telemetry
Days
1
Full breakdown
1d 8h 30m 0s
Total hours
32.50
Total minutes
1950

What this cannot tell you

  • Computes the elapsed time between two moments. Bare dates are parsed in your local timezone.
  • It does not account for daylight-saving transitions between the two dates.

Take this with you

How this calculation works

Both moments are parsed and the difference is broken down into days, hours and minutes, plus total hours and minutes. Order does not matter — the duration is the same either way.

What the results mean

Breakdown vs totals
The result is shown both as a natural "2d 8h 30m" and as total hours and minutes, whichever you need.

Common problems and fixes

The duration is an hour off
A daylight saving transition fell between the two moments, so one of the days had 23 or 25 hours. The elapsed time is correct and the wall-clock difference is what changed. For scheduling, payroll or anything where the discrepancy matters, work in UTC, where no such transition exists.
I need working hours, not elapsed time
This measures the raw interval between two moments, which counts nights, weekends and holidays. Working-hours calculations need a definition of the working day and a holiday calendar, both of which vary by organisation and country — a spreadsheet with your own calendar is the practical route.
The result in months does not match what I counted
Months are not a fixed length, so any conversion from an exact interval into months involves a convention. Thirty days is not a month, and the answer differs depending on which months the period spans. Where an exact figure matters, use days — the only unit here with no ambiguity in it.

Frequently asked questions

Does it handle daylight saving?

It computes the raw elapsed time between the two moments. Across a daylight-saving change the wall-clock difference can look an hour off from the true elapsed time; for precise scheduling across DST, work in UTC.

Does it matter which date I enter first?

No. The duration between two moments is the same magnitude in either direction, so the order only affects the sign, which is not shown. That makes it safe to paste in two timestamps without checking which is earlier — a small thing that removes one reliable source of error.

How are leap years handled?

Correctly, because the calculation works on the actual calendar rather than assuming a 365-day year. A period spanning 29 February includes that day. The leap year rule itself is the one people half-remember: divisible by four, except centuries, except those divisible by 400 — so 2000 was a leap year and 1900 was not.

Put this on your own site

Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.

Embed code
<iframe src="https://runthetests.com/embed/time-duration-calculator/" width="100%" height="560" style="border:1px solid #e5e5e5;border-radius:8px" title="Time Duration Calculator" loading="lazy"></iframe>

Preview it at https://runthetests.com/embed/time-duration-calculator/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.

More in Calc