Time Duration Calculator

About this calculator

The Time Duration Calculator measures elapsed time down to the second. Compare two clock times on the same day (overnight spans are handled), or two times on different dates. The answer is given in days, hours, minutes and seconds, and also as total days, total hours, total minutes and total seconds.

Leave blank for today.
Start time
Leave blank for today.
End time
Embed this calculator

Paste this code into a Custom HTML block on your site. The calculator fits the width of the block. Adjust the height in the code if you want more room for results.

Find this widget in the publisher directory

Measuring a duration

A duration is the amount of time that passes between a start and an end. To compute one precisely, express both moments as a number of seconds from a common reference point, subtract, and then break the difference back into days, hours, minutes and seconds. Working in seconds avoids every pitfall of mixed units: 60 seconds per minute, 60 minutes per hour and 24 hours per day.

Seconds of a clock time = hour₂₄ × 3,600 + minute × 60 + second
Duration = end − start (add 86,400 if the end time is earlier on the same-day mode)
Days = ⌊duration ÷ 86,400⌋, hours = ⌊rest ÷ 3,600⌋, minutes = ⌊rest ÷ 60⌋, seconds = remainder

Converting a 12-hour clock to 24-hour form: 12:xx AM becomes 0:xx, 1 AM to 11 AM stay the same, 12:xx PM stays 12:xx, and 1 PM to 11 PM add 12.

Between two times on the same day

The first mode compares two clock times. If the end time is earlier than the start, the calculator assumes the start was the previous day, which is the usual meaning for night shifts, flights that land after midnight, or sleep.

Worked example: an overnight span

From 9:45:20 PM to 3:10:05 AM. The start is 21 × 3,600 + 45 × 60 + 20 = 78,320 seconds. The end is 3 × 3,600 + 10 × 60 + 5 = 11,405 seconds. The end is earlier, so add 86,400: 11,405 + 86,400 − 78,320 = 19,485 seconds. That is 5 hours, 24 minutes and 45 seconds, or 5.413 hours, 324.75 minutes.

Between two dates and times

The second mode adds a date to each side, so the span can run for days, months or years. The calendar part is converted to whole days and multiplied by 86,400 seconds, then the clock parts are added.

Worked example

From January 15, 2026 at 8:30:00 AM to February 20, 2026 at 5:45:15 PM is 36 days, 9 hours, 15 minutes and 15 seconds. In single units that is 36.3856 days, 873.254 hours, 52,395.25 minutes or 3,143,715 seconds.

Precision of the decimal totals

TotalShown toExample
Days4 decimal places36.3856 days
Hours3 decimal places873.254 hours
Minutes2 decimal places52,395.25 minutes
SecondsWhole seconds3,143,715 seconds

Values smaller than 1 keep the same number of significant digits instead, so 59 seconds shows as 0.0164 hour and 0.98 minute rather than rounding toward zero.

Daylight saving time and time zones

Both modes use local wall-clock time. If the span crosses a daylight saving change, the true elapsed time differs by one hour from the result: one hour shorter in spring and one hour longer in autumn. If the two times are in different time zones, convert one of them first with the time zone calculator.

Everyday uses

  • Tracking how long a task, call, workout or race took.
  • Checking sleep length from bedtime to wake-up.
  • Measuring machine run time or downtime from log timestamps.
  • Working out the length of a trip between departure and arrival.

Converting between units

Once you have a duration in seconds, every other unit follows by division. Divide by 60 for minutes, by 3,600 for hours and by 86,400 for days. Going the other way, multiply. A 90-minute movie is 5,400 seconds or 1.5 hours; a 10,000-second task is 2 hours 46 minutes 40 seconds, or about 2.778 hours. When you need the answer in hours and minutes for a timesheet, take the whole hours first and convert only the fractional part back to minutes by multiplying it by 60.

Seconds are optional: leave them at 0 when you only care about hours and minutes.

Frequently asked questions

How do I calculate the time between two times?
Convert both to seconds after midnight, subtract the start from the end, and add 24 hours if the end is earlier. Then split the result into hours, minutes and seconds.
How many seconds are in a day?
86,400 seconds: 24 hours × 60 minutes × 60 seconds.
How do I find elapsed time across midnight?
Add 24 hours to the end time before subtracting. 9:45 PM to 3:10 AM is 5 hours 25 minutes.
Does the calculator handle daylight saving time?
No. It uses clock time; across a DST change the true elapsed time differs by one hour.

Formulas and sample results on this page were checked against independent references. Page last reviewed or updated . How we verify calculators. Project led by Shaun Connell.