KitQuarter

Time Duration Calculator: Hours Between Two Times

Find the exact time between any two dates and times — in days, hours, minutes and seconds. Works across midnight and multi-day spans.

How the time duration calculator works

A time duration calculator measures the exact gap between two points in time. Enter a start date and time and an end date and time, and the calculator subtracts the start from the end, then breaks the result into days, hours, minutes and seconds.

Diagram showing how time duration is calculated: a timeline from Start 09:00 to End 17:30 with the formula Duration equals End minus Start, giving 8 hours 30 minutes
The core idea: duration is simply the end timestamp minus the start timestamp, broken into familiar units.

The calculation works the same whether the two times fall on the same day, span midnight, or are weeks apart. Internally everything is converted to a single number of seconds, the subtraction happens once, and the result is converted back into days, hours, minutes and seconds for display.

If you need to find someone's age from a birth date instead of a duration between two arbitrary times, our age calculator handles years, months and days specifically.

The time duration formula

The math behind a duration is a single subtraction, done in the smallest unit to avoid rounding errors:

  1. Convert both timestamps to total seconds since a fixed reference point.
  2. Subtract: duration in seconds = end seconds − start seconds.
  3. Break down the seconds: days = seconds ÷ 86,400; hours = remainder ÷ 3,600; minutes = remainder ÷ 60; seconds = final remainder.

Useful conversions: 1 day = 86,400 seconds, 1 hour = 3,600 seconds, 1 minute = 60 seconds. Decimal hours = total minutes ÷ 60. So 510 minutes is 8.5 hours.

Worked example

Find the duration from 09:00 to 17:30 on the same day:

  1. Convert to minutes: 09:00 = 9 × 60 = 540 minutes; 17:30 = 17 × 60 + 30 = 1,050 minutes.
  2. Subtract: 1,050 − 540 = 510 minutes.
  3. Break down: 510 ÷ 60 = 8 hours with 30 minutes left over.
  4. Result: 8 hours 30 minutes, which is 8.5 decimal hours or 30,600 seconds.
24-hour bar chart showing the worked example: 09:00 to 17:30 highlighted on a timeline, with step-by-step calculation giving 8 hours 30 minutes
09:00 to 17:30 on a 24-hour bar: the highlighted span is 8 hours 30 minutes.

Overnight and multi-day durations

When the end time is earlier in the day than the start time, the calculator treats the end as falling on the next day. A shift from 22:00 to 06:00 is 8 hours, not a negative number.

For multi-day spans, enter the actual calendar dates. From Monday 09:00 to Wednesday 17:30 is 2 days, 8 hours and 30 minutes — 56.5 hours in total. The date inputs make this automatic; you never have to add 24 hours by hand.

For quick percentage-style checks on time sheets, such as what share of a shift is overtime, the percentage calculator pairs well with duration results.

Common duration examples

StartEndDurationDecimal hours
09:0017:008 hours8.0
09:0017:308 hours 30 min8.5
22:0006:00 (+1 day)8 hours8.0
Mon 09:00Wed 17:302 days 8 h 30 min56.5
08:1512:454 hours 30 min4.5
00:0023:5923 hours 59 min23.98
Reference table of common time durations: 30 minutes equals 0.5 hours, 8 hours 30 minutes equals 8.5 hours and 30,600 seconds, 1 day equals 86,400 seconds
Handy conversions: decimal hours, total minutes and total seconds for common durations.

Frequently asked questions

How do you calculate the duration between two times?

Subtract the start time from the end time. Convert both to minutes (hours × 60 + minutes), subtract, then convert back: divide by 60 for hours and keep the remainder as minutes. From 09:00 to 17:30: 1,050 − 540 = 510 minutes = 8 hours 30 minutes.

What if the end time is earlier than the start time?

The calculator assumes the end falls on the next day. A shift from 22:00 to 06:00 is 8 hours. If you meant the same day, the result would be negative, so the overnight assumption is the useful default.

How do I convert minutes to decimal hours?

Divide minutes by 60. So 510 minutes ÷ 60 = 8.5 hours. The .5 means half an hour, i.e. 30 minutes. Payroll systems often use decimal hours, which is why the calculator shows both formats.

Can it handle durations longer than 24 hours?

Yes. Enter the real start and end dates and the calculator counts every full day in between. From Monday 09:00 to Friday 17:00 it reports 4 days and 8 hours (104 hours total).

Does it account for daylight saving time?

No. The calculator treats every day as exactly 24 hours. Across a daylight-saving changeover the real elapsed time can differ by an hour. For legal or payroll use across a DST boundary, verify with an authoritative time source.

What is the difference between duration and time interval?

They mean the same thing here: the amount of elapsed time between two timestamps. Duration is the common term in everyday use; interval is more common in scheduling and programming.

How accurate is the calculator?

Exact to the second for the times you enter. Accuracy depends on your inputs — the calculator cannot know about breaks, pauses or time-zone changes unless you adjust the start and end times yourself.