Timekeeping guide

Calculating Working Hours Across Midnight

Calculate overnight shift duration, breaks and payable time without producing negative durations or assigning hours to the wrong date.

Purpose: Calculate a shift that ends on the following day without producing a negative duration.

3 min read 5 practical sectionsPublished by Nexynto ToolsSources reviewed 26 Nov 2026Updated 26 Nov 2026
Use the methodOpen calculator
Editorial illustration for Calculating Working Hours Across Midnight
Original Nexynto Tools illustration created for “Calculating Working Hours Across Midnight”. Calculations use the article inputs and stated assumptions, not the illustration.
01S: Start time in minutes
02E: End time in minutes
03B: Unpaid break minutes
Traceable calculation: inputs, method and result stay visibly separate.
Direct answer

What you need to know

When an end time is earlier than the start time and the shift is known to end the next day, add 24 hours to the end-time minute value before subtracting the start and unpaid breaks.

Formula variables and scope

S
Start time in minutes
E
End time in minutes
B
Unpaid break minutes

Worked examples

Night shift with a break

Inputs: 22:00 to 06:00; 30-minute unpaid break

  1. Add 24 hours to the 06:00 endpoint
  2. Subtract 30 minutes from the eight-hour span

Result: Net duration is 7 hours 30 minutes.

Limitation: Confirm that the end time is genuinely on the following day.

Short overnight shift

Inputs: 23:45 to 01:15; no break

  1. Normalize both times to minutes
  2. Treat 01:15 as the next calendar day

Result: Elapsed duration is 1 hour 30 minutes.

Limitation: Payroll rounding may differ from elapsed-time arithmetic.

Anchor both times to dates

Clock times alone are ambiguous. An end at 06:45 may be next morning or earlier on the same date. Store or record the actual start and end dates whenever a shift can cross midnight.

Convert to elapsed minutes

For a verified overnight shift starting 22:15 and ending 06:45 next day, add 1,440 minutes to the end value. The elapsed duration is 1,845 - 1,335 = 510 minutes, or 8 hours 30 minutes.

Deduct breaks once

Subtract only unpaid break time that occurred within the shift. A 30-minute unpaid break changes 510 elapsed minutes to 480 payable minutes, which is exactly 8:00 hours or 8.0 decimal hours.

Separate duration from payroll rules

Cross-midnight arithmetic determines elapsed time, not overtime, night premiums, rounding or which payroll day receives the hours. Apply the applicable contract and legal rules after the duration is established.

Handle longer shifts explicitly

Do not automatically add 24 hours when multi-day work or erroneous entries are possible. Validate maximum plausible duration, overlapping entries, daylight-saving changes and duplicated breaks before approving a record.

InputExampleMinute value
Start22:151,335
Next-day end06:451,845 after adding 1,440
Unpaid break30 minutesSubtract after elapsed time

Put the method into practice

Use the related calculator with your own verified values and review the visible breakdown.

Open calculator

Related calculators

Frequently asked questions

What should I verify about anchor both times to dates?

Clock times alone are ambiguous. An end at 06:45 may be next morning or earlier on the same date. Store or record the actual start and end dates whenever a shift can cross midnight.

What should I verify about convert to elapsed minutes?

For a verified overnight shift starting 22:15 and ending 06:45 next day, add 1,440 minutes to the end value. The elapsed duration is 1,845 - 1,335 = 510 minutes, or 8 hours 30 minutes.

What should I verify about deduct breaks once?

Subtract only unpaid break time that occurred within the shift. A 30-minute unpaid break changes 510 elapsed minutes to 480 payable minutes, which is exactly 8:00 hours or 8.0 decimal hours.

What should I verify about separate duration from payroll rules?

Cross-midnight arithmetic determines elapsed time, not overtime, night premiums, rounding or which payroll day receives the hours. Apply the applicable contract and legal rules after the duration is established.

References and scope

Unit conversions use defined measurement relationships. Product coverage, institution policies, employment treatment, package quantities and regional requirements remain context-specific.

This guide is educational and does not replace current official guidance, a contract, manufacturer instructions, approved plans, lender disclosures, registrar records or qualified professional advice.