Dev.to AI 🤖 Ai 👁 2 📖 3 min read

Time Card Math: Turning Clock Times Into Payable Hours (Lunch, Overnight Shifts, Rounding)

Payroll systems pay decimal hours. A time card is full of clock times: 8:05 in, 4:50 out, a 30-minute lunch. Between the two sits a short piece of arithmetic that is easy to get wrong, and every mistake lands on someone'

Payroll systems pay decimal hours. A time card is full of clock times: 8:05 in, 4:50 out, a 30-minute lunch. Between the two sits a short piece of arithmetic that is easy to get wrong, and every mistake lands on someone's paycheck.

Here is the whole method, plus the spreadsheet formulas if you want to build it yourself.

1. Elapsed time, including overnight shifts

Subtract the clock-in time from the clock-out time.

  • 8:00 AM to 5:00 PM is 9 hours.
  • 10:00 PM to 6:30 AM crosses midnight, so the subtraction goes negative. Add 24 hours and you get 8.5 hours.

2. Subtract unpaid breaks

Only unpaid time leaves the total. A 30-minute unpaid lunch comes out; a paid 15-minute rest break stays in.

8:00 AM to 5:00 PM with a 30-minute lunch is 9 − 0.5 = 8.5 hours.

Enter breaks as a number of minutes, not as a clock time, and use them exactly as written.

3. Convert minutes to decimal hours

Divide the minutes by 60 and add the result to the whole hours.

Clock time Decimal hours
7 hours 45 minutes 7.75
8 hours 15 minutes 8.25
6 hours 30 minutes 6.50

The classic error is writing 7:45 as 7.45. That reads as 7 hours 27 minutes, and it quietly cuts 18 minutes from the day.

4. Split regular hours and overtime

Under a weekly overtime rule, everything up to 40 hours in the workweek is regular time and the rest is overtime.

Take a week of four 8.5-hour days (8:00 AM to 5:00 PM with a half-hour lunch), a 5.5-hour Friday and a 4-hour Saturday: 4 × 8.5 + 5.5 + 4 = 43.5 hours. At $20 an hour that is 40 × $20 = $800 for the first 40 hours, plus 3.5 × $30 = $105 for the overtime. Gross pay: $905.

Under a daily rule the cut-off is the length of the day instead. 8:00 AM to 5:30 PM with a 30-minute lunch is a 9-hour day: 8 regular hours and 1 overtime hour.

California applies both at once (daily overtime after 8 hours, weekly overtime after 40, double time after 12). When both rules apply, an hour that already counts as daily overtime is not counted a second time toward the weekly 40.

5. Rounding

Some employers round each punch before doing the math, most often to the nearest 15 minutes or with the 7-minute rule. Two things to keep straight:

  • Rounding applies to clock-in and clock-out punches. Break minutes are used as typed.
  • In the US, federal rules allow rounding to the nearest quarter hour as long as it averages out over time and does not regularly shave time off. State rules and company policies differ, so check yours.

Both charts, with worked examples, are in this guide to time card rounding rules.

Do it in a spreadsheet

Put the clock-in time in B2, the clock-out time in C2 and unpaid break minutes in D2:

=MOD(C2-B2,1)*24-D2/60

MOD wraps the subtraction into a 24-hour day, so overnight shifts need no IF statement. For a week of these in E2:E8:

Total hours:     =SUM(E2:E8)
Regular hours:   =MIN(E9,40)
Overtime hours:  =MAX(0,E9-40)

Multiply regular hours by the hourly rate and overtime hours by 1.5 times the rate.

Or skip the sheet

If you would rather not build it, I publish a free time card calculator that runs this in the browser: 1 to 4-week pay periods with real dates, up to four shifts a day, a break per shift or an automatic deduction, a 12- or 24-hour clock, weekly, daily, daily + weekly and California overtime, punch rounding, and gross pay. It prints a time card with signature lines, exports CSV, and saves your entries in the browser. There is no sign-up. For a plain Monday-to-Sunday sheet there is also a weekly timesheet calculator.

*This article was drafted with an AI assistant (GLM) at the request of the site owner.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.