Night Shift Hours Calculation for Shifts That Cross Midnight
Night shift hours calculation made simple: which day a shift past midnight belongs to, how to count hours, lateness and overtime, and avoid payroll errors.
Night shift hours calculation is simple once you add 24 hours to any end time that falls after midnight: a shift from 22:00 to 06:00 is (6 + 24) – 22 = 8 hours, less any unpaid break. The harder part is booking the whole shift to one working day, normally the day it started, so attendance, lateness and overtime are counted once and not split across two dates.
This guide covers which day a night shift belongs to, how to count hours, lateness, overtime and rest, the common payroll errors, and how a “day starts at” setting removes them.
Which day does a night shift belong to?
A shift from 22:00 on Monday to 06:00 on Tuesday touches two dates. You have three choices:
| Approach | Monday 22:00 to Tuesday 06:00 is booked as | Problem |
|---|---|---|
| The day it starts | Monday, 8 hours | None, if you apply it the same way every time |
| The day it ends | Tuesday, 8 hours | The timesheet no longer matches the rota, which says Monday, and the last night of the week moves into the next week |
| Split at midnight | Monday 2 hours, Tuesday 6 hours | Two half days, wrong lateness and overtime, double counting |
Booking the shift to the day it starts is the easiest rule to apply consistently, and Pakistan’s factories law points the same way. Section 46 of the Factories Act 1934, which covers factories in Islamabad, says that when a shift extends over midnight, the hours worked after midnight count towards the previous day, and the worker’s next day begins when the shift ends. Section 67 of the Sindh Factories Act 2015 has the same rule. Both let the government direct otherwise for specific factories, and the other provinces have their own laws, so check the one that applies to you.
Night shift hours calculation, step by step
- Write the start and end in 24-hour time.
- If the end is smaller than the start, add 24 to the end.
- Subtract the start, then subtract any unpaid break.
| Shift | Calculation | Unpaid break | Hours worked |
|---|---|---|---|
| 22:00 to 06:00 | (6 + 24) – 22 = 8 | 30 minutes | 7.5 |
| 20:00 to 05:30 | (5.5 + 24) – 20 = 9.5 | 60 minutes | 8.5 |
| 23:30 to 08:15 | (8.25 + 24) – 23.5 = 8.75 | 45 minutes | 8.0 |
Remember that minutes are sixtieths of an hour: 05:30 is 5.5 and 08:15 is 8.25. In Excel, with the start in C2, the end in D2 and break minutes in E2, =MOD(D2-C2,1)*24-E2/60 gives decimal hours for day and night shifts alike. Our free attendance sheet template uses the same approach.
How do you measure lateness on a night shift?
Measure it against the shift start, not the office day. If the shift starts at 22:00 and the grace period is 10 minutes, a clock-in at 22:20 is 20 minutes late. Watch for two traps:
- A clock-in after midnight looks early. If your system thinks every day starts at midnight, someone who arrives at 00:10 for a 22:00 shift looks like an early arrival on the next date, not two hours late for this shift.
- Rotation days. When someone moves from days to nights, make sure the expected start changes on the right date. Otherwise the first night shows as hours late, or the last day shift shows as absent.
Let attendance mark itself.
Zealtrack takes the clock-in and clock-out from each computer, fills timesheets by itself and builds late and overtime reports with CSV export. Free for unlimited users, no credit card.
How is overtime calculated on a night shift?
Compare the hours with the normal day and week for that worker, using the working day each shift belongs to. Here is a hypothetical example: a factory worker in Islamabad works six night shifts of 9 hours, 54 hours in total. The Factories Act 1934 sets a 48-hour week (section 34) and a 9-hour day (section 36), and section 47 pays overtime at twice the ordinary rate. So 6 hours are overtime. If each shift were split at midnight, every calendar date would hold pieces of two different shifts, and the daily check would stop making sense.
Rules differ by country:
- UAE: the government portal u.ae says normal hours are 8 a day or 48 a week, and overtime is paid at the normal hourly wage (based on basic salary) plus 25%, rising to 50% for overtime worked between 10 pm and 4 am. It adds that this rule does not apply to workers who work in shifts.
- Saudi Arabia: the Ministry of Human Resources and Social Development says overtime is paid at the hourly wage plus 50% of the basic wage.
- Pakistan: normal hours, rates and limits vary by province and type of workplace. Our overtime calculator for Pakistan lists them, with the law sections.
What about breaks and rest between shifts?
Night work makes rest easy to miss. Check two things in your records:
- Breaks within the shift. Section 37 of the Factories Act 1934 says work periods must be arranged so that no adult worker works more than six hours before a rest of at least one hour, or more than five hours before a rest of at least half an hour. Section 38 limits the spread of the working day, rest included, to 12 hours. In the UAE, u.ae says workers who work five consecutive hours are entitled to a break of at least one hour, which does not count as working time.
- Rest between shifts. Look at the gap between one clock-out and the next clock-in. A worker who finishes a night shift at 06:00 and starts a day shift at 14:00 the same day has had eight hours, journey home included. Flag short turnarounds, especially when people swap shifts with each other.
Common payroll errors with night shifts
- One shift split into two half days on the timesheet.
- Negative hours, or
####in a spreadsheet, because the end time is “before” the start. - A worker shown absent on the day the shift started, because all the hours landed on the next date.
- Lateness measured against the office start time instead of the shift start.
- Daily overtime checked per calendar date, so a long shift never crosses the daily limit.
- A shift that starts on the eve of a public holiday booked to the holiday itself, so holiday rules apply to the wrong hours.
- A clock-out after midnight treated as a forgotten clock-out and replaced with a guess.
How a “day starts at” setting solves it
The cleanest fix is to stop using midnight as the edge of the working day. Choose a “day starts at” time in the quiet gap after your night shift ends and before your first day shift begins. Everything from that time until the same time the next day is one working day.
Example: your night shift runs 22:00 to 06:00 and your day shift 08:00 to 16:00. Set the day to start at 07:00. Monday’s working day now runs from 07:00 on Monday to 06:59 on Tuesday, so Monday’s day shift and Monday’s night shift both belong to Monday. Hours, lateness, overtime and rest are counted per working day, and the midnight problem disappears.
Zealtrack has this setting. It supports shifts, including overnight shifts, and a “day starts at” setting so a night shift that crosses midnight counts as one working day. The agent on each Windows or macOS computer takes the clock-in from the first activity and the clock-out from the last, timesheets fill themselves with every edit logged, and the shift time, late clock-in and overtime reports all export to CSV. It is free for unlimited users, so you can set up your night team free and check a week of shifts against your own records. It only covers people who work on a computer; for a factory floor without computers, a punch clock is the better tool.
Night shifts are only hard when midnight decides the date. Pick one rule, book each shift to one working day, and check rest as carefully as hours. Try Zealtrack free, or book a 30-minute demo to see your own shift pattern set up.
Frequently asked questions
Does a night shift count as one day or two?
One, if you book the whole shift to a single working day, usually the day it started. Pakistan’s Factories Act 1934 (section 46) and Sindh Factories Act 2015 (section 67) count the hours after midnight towards the previous day.
How do you calculate hours for a shift that crosses midnight?
Add 24 to the end time, then subtract the start time and any unpaid break. A 21:00 to 05:00 shift is (5 + 24) – 21 = 8 hours. In Excel, use =MOD(end-start,1)*24.
Do night shift workers get paid more?
It depends on the law and the contract. In the UAE, u.ae says overtime between 10 pm and 4 am is paid at 50% extra, but that the rule does not apply to shift workers. Elsewhere, check your labour law and the employment contract, which may set a night allowance.
What “day starts at” time should I choose?
A time when nobody is working: after the last night shift ends and before the first day shift begins. If shifts overlap around the clock, pick the quietest changeover and apply it to everyone.
This guide is general information, not legal advice. Laws change; check the official text or a lawyer before you act. Sources checked on 29 November 2026.