hasibai

Date & time

Time duration calculator

Time arithmetic is base 60, which is why it goes wrong so often. Work out the gap between two times, or add and subtract durations, without borrowing in your head.

Unpaid lunch or rest breaks, removed from the total.

Duration
Enter two times to see the gap.

Why time arithmetic goes wrong

We do everything else in base 10 and then switch to base 60 for time without announcing it. Subtracting 09:45 from 17:15 tempts you to do 17 − 9 and 15 − 45, and the negative minutes are where the mistake creeps in. You have to borrow 60, not 100.

17:15 − 09:45 → 16:75 − 09:45 = 7 h 30 m

Converting both times to minutes past midnight first removes the problem entirely, which is what this calculator does internally. 17:15 is 1035 minutes, 09:45 is 585, and the difference of 450 minutes converts back to 7 h 30 m.

Decimal hours and the payroll trap

Payroll systems are almost always fed decimal hours, not hours and minutes, and the conversion is where money goes missing. Forty-five minutes is 0.75 hours, not 0.45. Typing 7.30 for seven and a half hours underpays by twelve minutes every time.

MinutesDecimalMinutesDecimal
50.08350.58
100.17400.67
150.25450.75
200.33500.83
300.50550.92

The conversion is simply minutes divided by 60. Anything that does not divide evenly leaves a repeating decimal, which is why timesheets rounded to two places drift by a few seconds per entry.

Crossing midnight

An end time earlier than the start time is ambiguous: either the shift ran overnight, or someone typed the times the wrong way round. There is no way to tell from the numbers alone, so this calculator lets you choose which interpretation applies. Night shifts, flight times and server logs all routinely cross midnight and need the overnight reading.

What this deliberately ignores

Daylight saving transitions make one day 23 hours long and another 25. A shift running through the spring-forward change is an hour shorter in real elapsed time than the clock suggests, and many jurisdictions have specific rules about how that hour is paid. This calculator works in plain clock time and does not adjust for it. If a shift crosses a transition, check the local rule.

Common questions

How do I convert minutes to decimal hours?

Divide by 60. Fifteen minutes is 0.25 hours, twenty minutes is 0.333, and fifty minutes is 0.833. The common error is treating the minutes as decimal places, which understates anything over 36 minutes and overstates anything under it.

How many hours is 9 to 5 with an hour for lunch?

Eight hours elapsed, seven hours worked once the unpaid break comes out. That is why a "nine to five" job is usually a 35-hour week rather than 40 — a 40-hour week with unpaid lunch actually runs nine hours a day.

Can it handle a shift that runs past midnight?

Yes. When the end time is earlier than the start, the default is to treat it as the next day, so 22:00 to 06:00 returns eight hours. You can switch that to flag an error instead if your times should never cross midnight.

Why do my timesheet totals differ by a few minutes from the payroll figure?

Rounding. Many employers round each entry to the nearest five, six or fifteen minutes rather than using exact times, and the rounding rule compounds across a week. In several jurisdictions rounding is only lawful if it is neutral over time rather than always in the employer’s favour.