How to calculate overnight shift hours correctly
Why a shift that crosses midnight breaks naive subtraction, how the 24-hour clock fixes it, and how to total overnight hours for payroll.
Why midnight breaks simple subtraction
Clock time resets to zero at midnight, so a shift that starts at 22:00 and ends at 06:00 looks like it runs backwards if you just subtract. Plain subtraction gives 06:00 minus 22:00, which is a negative eight hours rather than the real eight-hour span. The information about which day the end time belongs to is missing from the clock face alone. That is exactly why this calculator refuses to guess and instead asks you to confirm the shift is overnight.
The next-day fix
When you tick the cross midnight box, the tool adds 24 hours (1440 minutes) to the end time before subtracting. So 06:00 becomes the equivalent of 30:00 on the same timeline as the 22:00 start, and 30:00 minus 22:00 leaves a clean eight hours. This mirrors how a payroll system treats a clock-out stamp that carries a later date than the clock-in. The single toggle keeps the interface simple while still handling the one case that trips people up.
Totalling hours for pay
For a timesheet you usually want two numbers: the readable duration and the raw minutes. An 8h 0m overnight shift is 480 minutes, and a 22:15 to 06:45 shift is 8h 30m or 510 minutes. Converting to minutes first makes it easy to sum several shifts and only divide by 60 at the end, which avoids rounding drift. Keep in mind that many overnight schedules also involve a night differential or an unpaid break that this raw span does not subtract.
What this tool leaves out
The calculator measures clock-to-clock time and nothing more. It does not deduct meal breaks, apply overtime rules, or adjust for a daylight saving transition that adds or removes an hour of real time overnight. It also caps at a single 24-hour window, so a 26-hour on-call block is out of scope. Treat the result as the gross span and layer your own break and premium rules on top.