The maths behind a simple shift, and the one rule that handles overnight shifts.
The most basic question in timekeeping is also the one people get wrong most often on overnight shifts: how many hours passed between a start time and an end time? For a same-day shift, it's simple subtraction. For a shift that crosses midnight, there's one extra step.
Convert both times to 24-hour minutes-since-midnight, then subtract the start from the end.
When the end time is earlier in the clock than the start time — like 9:00 PM to 5:00 AM — a plain subtraction gives a negative number, which is obviously wrong. The fix: if the result is negative (or zero), add 24 hours (1,440 minutes) to it, since the shift actually ended the next calendar day.
Notice both examples land on exactly 8 hours — that's not a coincidence, it's the same shift length, just shifted by 12 hours into the night. Getting the overnight rule right means a night-shift worker's hours are just as accurate as a day-shift worker's.
An overnight shift runs from 11:30 PM to 6:15 AM.
The Hours Calculator applies this exact rule automatically, so you can check any shift — day or night — without doing the minutes maths by hand.
Most of the confusion in this kind of maths comes from converting AM/PM times correctly. On a 24-hour clock, midnight is 00:00 and noon is 12:00 — there's no ambiguity. On a 12-hour clock, midnight is written as 12:00 AM and noon as 12:00 PM, which trips people up because the "12" doesn't behave like every other hour does when switching between AM and PM. The safest approach for calculations is to convert everything to 24-hour time first: for AM hours, the 24-hour hour is the same number (except 12 AM, which becomes 00); for PM hours, add 12 to the 12-hour value (except 12 PM, which stays 12).
If the start time and end time are identical, the elapsed time is either 0 hours (nothing happened) or a full 24 hours (an entire day passed), depending on context. Most of the time this points to a data-entry mistake rather than an actual 24-hour shift, so it's worth double-checking the clock-in and clock-out values if you see this result.
Getting elapsed time right isn't only about pay. Scheduling software, break compliance, and even simple things like knowing when a shift actually ends all depend on the same start-to-end calculation. A scheduling tool that mishandles overnight shifts might show a night-shift worker's hours as negative or wildly wrong, which cascades into wrong weekly totals and wrong overtime calculations later. Getting this one calculation right at the source is what makes every calculation built on top of it (weekly totals, overtime, pay) trustworthy.
Estimates only. Not legal, tax, or payroll advice.