This is a transparency page, not a calculator — it exists to show exactly how the SumHours engine behaves on specific inputs, so you can check our work rather than take it on faith. For the formulas themselves, see how we calculate.
Work Hours Calculator Edge-Case Test Suite
A reproducible reference, not a comparison to any other tool. Every “Result” below is copied directly from a real run of the engine that powers this site — generated by a script kept in this project’s source, not typed in by hand — so this table can’t quietly drift from what the calculators actually do. Where a case is rejected, that’s shown as the error it actually throws, not a made-up number. Try any of these yourself on the relevant calculator to confirm.
| Scenario | Input | Expected result | How the calculation works | SumHours result |
|---|---|---|---|---|
| Normal same-day shift | 09:00 to 17:00 | 8 hours elapsed | Elapsed time between start and end. | 8:00 (8 decimal hours) |
| Midnight crossing | 22:00 to 06:00 | 8 hours elapsed | End earlier on the clock than start ⇒ treated as crossing into the next day. | 8:00 (8 decimal hours) |
| 12:00 AM as a time | 12:00 AM | Midnight, the start of the day | 12-hour AM/PM handling: 12:00 AM is midnight, not noon. | Parses to minute 0 of the day |
| 12:00 PM as a time | 12:00 PM | Noon | 12:00 PM is noon, not midnight. | Parses to minute 720 of the day |
| 24-hour input | 17:30 to 23:00 | 5.5 hours elapsed | 24-hour clock format, typed directly. | 5:30 (5.5 decimal hours) |
| Shorthand input | 815 to 1730 | Same as 8:15 to 17:30 | No separator: the last two digits are always minutes. | 9:15 (9.25 decimal hours) |
| Period-separated shorthand | 7.15 | Same as 7:15 | A period stands in for the colon. | Parses to minute 435 of the day |
| Zero-minute break | 09:00–17:00, one 0-minute break | Unchanged: 8 hours | A zero-minute break is accepted and deducts nothing. | 8:00 |
| One unpaid break | 09:00–17:00, one 30-minute break | 7.5 hours paid | Shift duration minus the unpaid break. | 7:30 (7.5 decimal hours) |
| Multiple breaks | 09:00–17:00, breaks of 15 and 30 minutes | 7.25 hours paid | Every unpaid break is summed and deducted. | 7:15 (7.25 decimal hours) |
| Invalid hour | 25:00 | Rejected, not guessed at | A malformed time is refused, never guessed into a number. | Rejected: “Hours must be 0-23.” |
| Invalid minutes | 09:75 | Rejected, not guessed at | Same rule for the minutes component. | Rejected: “Minutes must be 0-59.” |
| Blank/missing end time | A shift with a start time and no end time | Rejected, not treated as zero | Never calculated as zero or guessed — flagged as missing. | Rejected: “Shift 1 has no end time.” |
| Equal start and end times | 09:00 to 09:00 (default) | Zero — treated as a typo by default | Ambiguous by default: treated as a zero-length entry unless you say otherwise. | 0:00 |
| Equal start and end, full day chosen | 09:00 to 09:00, “full 24-hour shift” selected | 24 hours, only because you chose it | You explicitly choose the full-day meaning; we never assume it. | 24:00 |
| Rounding enabled | 09:07–17:00, rounded to the nearest 15 minutes | Rounded up to 8:00 | Paid duration only, rounded up/down/nearest as you choose. | 8:00 |
| Raw vs rounded, same case | 09:07–17:00, rounded to the nearest 15 minutes | Both the exact and rounded figures, kept together | Rounding never discards the exact time. | Worked time 7:53 (7.88h); rounded payroll time 8:00 (8h) |
| Decimal conversion | 7 hours 30 minutes | 7.5 | Minutes ÷ 60, to your chosen precision. | 7.5 decimal hours |
| Decimal conversion, reverse | 42.25 decimal hours | 42 hours 15 minutes | The same conversion, inverted. | 2535 minutes (42 hours 15 minutes) |
| Multiple shifts in one total | 09:00–13:00 and 14:00–18:00 | 8 hours combined | Every shift’s paid duration is summed. | 8:00 (8 decimal hours) |
| Weekly total with overtime threshold | Five 8-hour days, threshold set to 40 hours | 40 hours, all regular — the threshold isn’t crossed | Paid minutes split at the threshold you set; nothing above it here. | 40:00 total — 2400 regular minutes, 0 overtime minutes |
| Punch (clock-in/out) pairs | 8:02 AM–12:15 PM and 12:47 PM–5:09 PM | Both pairs summed, gap between them excluded | Each pair is its own shift; the gap between OUT and the next IN is already excluded. | 8:35 (8.58 decimal hours) |
Unsupported today, stated plainly rather than left to guesswork: the calculators on this site don’t collect a date or time zone, so daylight-saving-aware elapsed time (which the engine supports and tests — see Known limitations on the methodology page) isn’t exercised by anything above.
How these numbers are generated
Every “SumHours result” above comes from the same engine that powers the calculators on this site, run through a script kept in the project’s own source rather than typed in by hand — so this page can’t silently drift from what the tool actually does. See our methodology page for the full formulas and the live, automated test count.
Try these yourself
- Hours Calculator — single shift, breaks, decimal output.
- Work Hours Calculator — a full week, with overtime.
- Clock In Calculator — multiple punch pairs.
- Shift Calculator — one shift, including overnight.
- Time to Decimal Calculator — the decimal-conversion cases above, plus a full 0–59 minute reference table.