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.

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:
- Convert both timestamps to total seconds since a fixed reference point.
- Subtract: duration in seconds = end seconds − start seconds.
- 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:
- Convert to minutes: 09:00 = 9 × 60 = 540 minutes; 17:30 = 17 × 60 + 30 = 1,050 minutes.
- Subtract: 1,050 − 540 = 510 minutes.
- Break down: 510 ÷ 60 = 8 hours with 30 minutes left over.
- Result: 8 hours 30 minutes, which is 8.5 decimal hours or 30,600 seconds.

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
| Start | End | Duration | Decimal hours |
|---|---|---|---|
| 09:00 | 17:00 | 8 hours | 8.0 |
| 09:00 | 17:30 | 8 hours 30 min | 8.5 |
| 22:00 | 06:00 (+1 day) | 8 hours | 8.0 |
| Mon 09:00 | Wed 17:30 | 2 days 8 h 30 min | 56.5 |
| 08:15 | 12:45 | 4 hours 30 min | 4.5 |
| 00:00 | 23:59 | 23 hours 59 min | 23.98 |

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.