DevCalcHub

Time Duration Calculator – Hours Between Two Times

Use this hours calculator to find the time duration between a start time and an end time in hours and minutes — for work shifts, timesheets, study sessions or events, including night shifts that cross midnight.

By DevCalcHub Editorial Team · Last updated:

Formula

Duration is calculated as the difference between end time and start time:

Duration = End Time − Start Time

If the end time is earlier than the start time, it's assumed to be the next day:

Duration = (24:00 − Start Time) + End Time

Worked example

For a start time of 9:00 AM and an end time of 5:30 PM:

Start time: 09:00
End time: 17:30

Duration = 8h 30m

How to use this time duration calculator

  • Enter the start time.
  • Enter the end time.
  • The duration appears in hours and minutes. If the end time is earlier than the start time, the calculator assumes it is the next day.

Converting minutes to decimal hours

Timesheets and payroll systems often need hours as decimals. Divide the minutes by 60:

MinutesDecimal hours
10 minutes0.17
15 minutes0.25
20 minutes0.33
30 minutes0.50
45 minutes0.75
8 hours 30 minutes8.50

How to calculate hours worked

  • Find the duration from start to finish — for example 9:00 to 17:30 is 8 hours 30 minutes.
  • Subtract unpaid breaks — a 30-minute lunch leaves 8 hours of work.
  • Add up each day for your weekly total — 5 days × 8 hours = 40 hours.

12-hour and 24-hour time

12-hour24-hour
12:00 AM (midnight)00:00
9:00 AM09:00
12:00 PM (noon)12:00
5:30 PM17:30
10:00 PM22:00

To count days rather than hours, use the Date Difference Calculator.

Frequently asked questions

How does this handle shifts that cross midnight?

If the end time is earlier in the clock than the start time (e.g. 10:00 PM to 6:00 AM), the calculator assumes the end time falls on the next day and calculates the duration accordingly.

How do I calculate the hours between two times?

Subtract the start time from the end time. If the minutes are negative, borrow 60 minutes from the hours. 9:45 to 17:15 is 7 hours 30 minutes.

How do I calculate night shift hours?

Count the hours to midnight and add the hours after midnight. 10:00 PM to 6:00 AM is 2 hours + 6 hours = 8 hours. This calculator does it automatically when the end time is earlier than the start time.

How many hours are there from 9 AM to 6 PM?

9 hours. 9:00 AM is 09:00 and 6:00 PM is 18:00 in 24-hour time, and 18 − 9 = 9. If you take a 1-hour lunch break, that is 8 working hours.

How do I convert 7 hours 45 minutes to decimal?

Divide the minutes by 60 and add to the hours: 45 ÷ 60 = 0.75, so 7 hours 45 minutes is 7.75 hours.

Related calculators

Enter details

Duration

8h 30m

Total: 510 minutes