Overnight Shift Math: Calculating Shifts That Cross Midnight
Learn the +24h mathematical formula to calculate graveyard and third-shift hours crossing midnight without negative number errors.
Interactive Shift Hours Calculator
Shift Time & Duration
Supports standard daytime shifts and overnight cross-midnight schedules.
1. Why Overnight Shifts Break Standard Subtraction
The Midnight Boundary Problem (00:00 / 24:00)
When a shift starts at 22:00 (10:00 PM) and finishes at 06:00 (6:00 AM) the next day, naive arithmetic subtracts 22:00 from 06:00 (6 - 22 = -16 hours).
Because clocks reset to 00:00 at midnight, calculations crossing into the next calendar day must account for the 24-hour cycle.
2. The Universal Modular +24h Formula
How Automated Calculators Solve Overnight Shifts
Whenever End Time is numerically less than Start Time:
Elapsed Minutes = (1,440 - Start Minutes) + End Minutes
Worked Example: Shift from 22:30 to 07:00 with a 30-minute break.
• Start Time: 22:30 = (22 × 60) + 30 = 1,350 minutes from midnight.
• Minutes remaining in first day: 1,440 - 1,350 = 90 minutes (1h 30m).
• End Time: 07:00 = 7 × 60 = 420 minutes into the second day.
• Gross Elapsed Time: 90 + 420 = 510 minutes (8h 30m).
• Subtract 30-minute break: 510 - 30 = 480 net working minutes (8.00 decimal hours).
| Start Time | End Time | Elapsed Calculation | Net Hours (30m break) |
|---|---|---|---|
| 22:00 (10 PM) | 06:00 (6 AM) | (1440 - 1320) + 360 = 480m | 7.50 hrs |
| 23:00 (11 PM) | 07:30 (7:30 AM) | (1440 - 1380) + 450 = 510m | 8.00 hrs |
| 19:00 (7 PM) | 07:00 (7 AM) | (1440 - 1140) + 420 = 720m | 11.50 hrs (12h shift) |