Measuring elapsed time
Clock arithmetic is base 60 for minutes and base 24 for hours, which is why "5:45 minus 9:15" trips people up. The reliable way is to turn each time into minutes after midnight, subtract, and convert the difference back into hours and minutes. This page does exactly that, handles spans across midnight, and gives the decimal-hour figure that timesheets and invoices need.
The formulas
minutes(t) = 60 × hour + minute (24-hour clock) duration = minutes(end) − minutes(start) (+ 1,440 if negative and no dates) hours = ⌊duration / 60⌋, minutes = duration mod 60 decimal hours = duration / 60
Worked example
9:15 AM to 5:45 PM: 17 × 60 + 45 = 1,065 and 9 × 60 + 15 = 555. 1,065 − 555 = 510 minutes = 8 h 30 min = 8.5 decimal hours.
10:00 PM to 6:00 AM with a 30-minute break: 360 − 1,320 = −960, + 1,440 = 480 minutes, − 30 = 450 minutes = 7 h 30 min (7.5 hours).
Notes
- Times are whole minutes on a 24-hour day; daylight-saving transitions are not applied (see the FAQ).
- Decimal hours are rounded to 2 places for display — for payroll rounding rules see the time card calculator.
Sources: NIST Time and Frequency Division, Daylight Saving Time; ISO 8601-1:2019 (time-of-day representation).
Frequently asked questions
How do I calculate the time between two times?
Convert both to minutes after midnight, subtract, and convert back. 9:15 AM is 555 minutes, 5:45 PM is 1,065 minutes; 1,065 − 555 = 510 minutes = 8 hours 30 minutes. If the end is earlier than the start, the end is on the next day, so add 24 hours (1,440 minutes).
How do I convert hours and minutes to decimal hours?
Divide the minutes by 60 and add them to the hours. 8 h 30 min = 8 + 30/60 = 8.5 hours; 7 h 45 min = 7.75 hours; 20 minutes = 0.333 hours. Payroll systems and invoices usually want decimal hours.
What about shifts that cross midnight?
Leave the dates blank and the calculator assumes an end time earlier than the start is on the next day: 10:00 PM to 6:00 AM = 8 hours. For spans longer than a day, fill in both dates.
Does daylight saving time change the answer?
Not here: durations are calculated on clock time, as if every day had 24 hours. On the night clocks spring forward a 10 PM – 6 AM shift actually lasts 7 hours, and in the fall it lasts 9. Adjust by one hour on those two nights if you need the elapsed time.