Time difference basics
A time duration is the amount of time (hours and minutes) between two clock times. The challenge is handling edge cases like crossing midnight.
Clock time is different from calendar time: 09:00 and 17:30 are just times-of-day without a date attached. To find the difference, we convert both into a common unit (minutes), subtract, and convert back.
The calculator supports both 24-hour format (HH:mm like 17:30) and 12-hour format (h:mm AM/PM like 5:30 PM). Both produce identical results.
The tricky part is when the end time appears earlier than the start time — is it the same day (negative) or the next day (overnight)? The calculator lets you choose.
- Start: 09:00
- End: 17:30
- Duration: 8h 30m
Try it: Time Duration
Convert times to a common unit (minutes), subtract, convert back.
Minutes-since-midnight method
The most reliable way to compute time differences is to convert each clock time into total minutes since midnight.
Any clock time can be expressed as minutes since midnight. For example, 09:00 is 9 hours x 60 = 540 minutes. 17:30 is 17 x 60 + 30 = 1050 minutes.
The duration is simply: end_minutes - start_minutes. In our example: 1050 - 540 = 510 minutes.
Convert back: 510 / 60 = 8 hours remainder 30 minutes = 8h 30m.
This method works for any time format (12h or 24h) once you normalize to 24-hour values. For 12h format, convert AM/PM: 5:30 PM = 17:30.
- 09:00 = 9 x 60 = 540 min
- 17:30 = 17 x 60 + 30 = 1050 min
- Difference: 1050 - 540 = 510 min
- 510 / 60 = 8h 30m
Try it: Minutes calculation
Hours x 60 + minutes = total minutes since midnight.
Overnight shifts (crossing midnight)
When the end time is earlier than the start time, you need to decide: same day (negative) or next day (overnight)?
Consider a night shift: 22:00 to 06:00. If we compute naively: 06:00 = 360 min, 22:00 = 1320 min. Difference = 360 - 1320 = -960 min = -16 hours. That is the same-day interpretation (end is 16 hours before start).
For overnight shifts, we add 24 hours (1440 min) to the end time: 360 + 1440 = 1800 min. Difference = 1800 - 1320 = 480 min = 8 hours.
The calculator offers both options: "Assume next day" (for night shifts) or "Same day" (for signed results).
Tip: In 12-hour format, 10:00 PM to 6:00 AM is almost always an overnight shift. Enable the overnight option.
- Start: 22:00 (1320 min)
- End: 06:00 (360 min)
- Same day: 360 - 1320 = -960 min = -16h
- Next day: (360 + 1440) - 1320 = 480 min = 8h
Try it: Overnight shift
For overnight shifts, add 1440 minutes (24 hours) to the end time.
Decimal hours for timesheets
Many payroll and timesheet systems use decimal hours (e.g., 8.5) instead of hours:minutes (8:30). The conversion is simple.
Decimal hours = total minutes / 60. That is it!
Example: 8h 30m = 510 minutes. 510 / 60 = 8.5 decimal hours.
Common conversions: 15 min = 0.25, 30 min = 0.5, 45 min = 0.75.
This format is useful because it simplifies arithmetic: 8.5 + 7.75 = 16.25 hours total (vs adding 8:30 + 7:45 mentally).
The calculator shows decimal hours automatically alongside the hours:minutes result.
- 8h 30m = 510 minutes
- 510 / 60 = 8.5 decimal hours
- 7h 45m = 465 / 60 = 7.75 decimal hours
Try it: See decimal hours
Decimal hours = total minutes / 60.
Common mistakes to avoid
Time calculations are error-prone. Here are the most common pitfalls and how to avoid them.
Mistake 1: Forgetting AM/PM. 5:00 and 5:00 PM are 12 hours apart! Always double-check the period when using 12-hour format.
Mistake 2: Interpreting overnight wrong. 11 PM to 2 AM is 3 hours (overnight), not -21 hours (same day).
Mistake 3: Confusing duration with clock time. 8.5 hours is a duration; 8:30 is a clock time. They look similar but mean different things.
Mistake 4: Rounding too early. Keep full minutes until the final step, then round if needed.
Tip: When in doubt, use 24-hour format — it eliminates AM/PM confusion entirely.
- 9:00 AM to 5:00 PM = 8 hours
- 9:00 PM to 5:00 AM = 8 hours (overnight)
- 9:00 AM to 5:00 AM = -4 hours (same day) or 20 hours (next day)
Try it: Check your work
Double-check AM/PM and consider whether midnight is crossed.
Real-world use cases
Time duration calculations appear in many everyday and professional scenarios.
Work hours: Calculate daily hours for timesheets. 9 AM to 5:30 PM (minus lunch) is common.
Night shifts: Healthcare, security, and hospitality workers often need overnight calculations.
Payroll: Convert to decimal hours for hourly wage calculations.
Meeting scheduling: How long was that conference call?
Travel: Duration between flight departure and arrival (ignoring time zones).
Cooking/baking: How long until the timer goes off?
Exercise: Track workout duration (start to finish).
- Clock in: 9:00 AM
- Lunch: 12:00 PM - 12:30 PM (30 min unpaid)
- Clock out: 5:30 PM
- Gross: 8h 30m, Net: 8h 0m
Related: Time Add/Subtract
Time arithmetic is everywhere — from timesheets to cooking timers.