Time duration calculator.
How long between two clock times, with unpaid breaks taken off, in hours and minutes and in the decimal hours payroll asks for. A shift that ends after midnight is counted properly rather than coming out negative.
- Duration
- 8h
- Decimal hours
- 8.00
- Total minutes
- 480
The midnight problem
Subtracting 22:00 from 06:00 gives minus sixteen hours. Every hand-built timesheet hits this the first time somebody works a night shift, and the usual fixes — clamping at zero, or taking the absolute value — are both wrong in a way that is hard to spot, because they produce a plausible number rather than an obviously broken one.
The correct reading is that the shift crossed into the next day, so the end time needs 24 hours added before the subtraction. 06:00 becomes 30:00, minus 22:00, is eight hours. This calculator applies that whenever the end is at or before the start.
Paid and unpaid breaks
Whether a break is paid depends on your jurisdiction and your contract, and short rest breaks are often treated differently from a meal break. The calculator subtracts only what you enter, so enter the minutes that are genuinely unpaid and leave the rest.
Frequently asked questions
How do I calculate the duration between two times?
Convert both times to minutes since midnight, subtract the start from the end, then divide by 60 for hours. Where the end is earlier than the start the shift has crossed midnight, so add 24 hours before subtracting. This calculator does that and takes off any unpaid break.
How long is an 8 hour shift with a 30 minute break?
Eight hours and thirty minutes of elapsed time, if the break is unpaid — you are at work from 09:00 to 17:30 to be paid for eight. If the break is paid, the shift is 09:00 to 17:00. Which one applies is a matter of contract, not arithmetic, so set the break field to the minutes that are genuinely unpaid.
Why does my shift show as negative hours?
Because the end time is earlier than the start and the calculation has treated them as the same day. A shift from 22:00 to 06:00 is eight hours, not minus sixteen. This calculator reads an earlier end time as crossing midnight, which is the usual bug in spreadsheet timesheets.
What is the duration in decimal hours?
Minutes divided by 60. Eight hours thirty is 8.5, not 8.30 — minutes are sixtieths, not hundredths. Payroll systems almost always want the decimal form, which is why it is shown alongside hours and minutes.
Related tools
- Hours calculator — a whole week rather than one span.
- Hours to decimal converter — the conversion table on its own.
- Military time converter — if the rota is written on a 24-hour clock.
Or stop doing the subtraction at all
HelloTime records clock-in and clock-out as they happen, handles the midnight rollover, and hands payroll approved hours. Free for one user.