Skip to content
MoneyDeck

Time Duration Calculator

Hours and minutes between two times — overnight shifts included

Updated · Free, no signup

If earlier than the start time, the end is taken as the next day.

min

Add whole days for spans longer than 24 hours.

Duration

8 hours 30 minutes

As h:mm

8:30

Decimal hours

8.5 h

Total minutes

510 min

Total seconds

30,600 s

Crosses midnight?

No
  • From 9:00 AM to 5:30 PM is 8 hours 30 minutes.
  • In decimal form that is 8.5 hours — multiply by an hourly rate to get pay.

About the Time Duration Calculator

This time duration calculator finds how much time passes between a start time and an end time. Enter the two clock times and it returns the elapsed time in hours and minutes, as h:mm, as decimal hours for payroll, and as total minutes and seconds. If the end time is earlier than the start time, it assumes the period runs past midnight — perfect for night shifts, flights and sleep.

It is built for quick everyday questions: how long was my shift, how many hours did I sleep, how long is the flight, how many hours between 9 AM and 5:30 PM, or how long did a meeting or class last. You can subtract an unpaid break and add whole days for spans longer than 24 hours.

Times are treated as wall-clock times in one time zone. For flights across time zones, convert both times to the same zone first (the time zone converter helps), and remember that a daylight-saving change overnight adds or removes an hour.

How to use the time duration calculator

  1. 1Enter the start time.
  2. 2Enter the end time — an earlier time means the next day.
  3. 3Add any unpaid break in minutes.
  4. 4For spans over 24 hours, add the whole extra days.
  5. 5Read the duration in hours and minutes or decimal hours.

Formula and method

Duration = (end − start, + 24 h if end < start) + extra days × 24 h − break

Both times are converted to minutes (or seconds) after midnight and the start is subtracted from the end. If the end time is earlier than the start time, the span must cross midnight, so 24 hours are added — 10:00 PM to 6:00 AM is 6:00 − 22:00 + 24:00 = 8 hours.

Any whole extra days are added, then the unpaid break is subtracted. Decimal hours are total minutes ÷ 60, the format most timesheets and payroll systems expect (8 h 30 min = 8.5 hours).

start, end
Clock times converted to minutes after midnight
24 h
Added once when the end time is before the start time

Worked examples

9:00 AM to 5:30 PM

From 9:00 to 17:30 is 8 hours 30 minutes, which is 510 minutes or 8.5 decimal hours.

Night shift 10:00 PM to 6:15 AM with a 30-minute break

Because 6:15 AM is earlier than 10:00 PM, the shift crosses midnight: 2 hours before midnight plus 6 h 15 min after is 8 h 15 min. Subtracting the 30-minute break leaves 7 h 45 min, or 7.75 hours.

Sleep from 11:40 PM to 7:05 AM

20 minutes until midnight plus 7 hours 5 minutes after it gives 7 hours 25 minutes of sleep — 445 minutes, or about 7.42 hours.

Frequently asked questions

How do I calculate the hours between two times?+

Convert both times to 24-hour format, subtract the start from the end, and borrow 60 minutes if the minutes go negative. If the end is earlier than the start, add 24 hours because the period crosses midnight.

How many hours is 9 AM to 5 PM?+

9 AM to 5 PM is 8 hours. With a 30-minute unpaid lunch break it is 7.5 paid hours, and 9 AM to 5:30 PM is 8 hours 30 minutes before any break.

How do I convert minutes to decimal hours?+

Divide the minutes by 60. 15 minutes is 0.25 hours, 30 minutes is 0.5, 45 minutes is 0.75 and 20 minutes is about 0.33. So 7 hours 45 minutes is 7.75 hours.

Does it work for overnight shifts?+

Yes. If the end time is earlier than the start time, the calculator assumes the end is on the next day and adds 24 hours, so 10 PM to 6 AM correctly gives 8 hours.

What about spans longer than a day?+

Use the extra full days field. For example 8:00 AM Monday to 10:00 AM Wednesday is 2 extra days plus 2 hours, which is 50 hours in total.

Related tools