SumHours Calculation Test Suite

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.

ScenarioInputExpected resultHow the calculation worksSumHours result
Normal same-day shift09:00 to 17:008 hours elapsedElapsed time between start and end.8:00 (8 decimal hours)
Midnight crossing22:00 to 06:008 hours elapsedEnd earlier on the clock than start ⇒ treated as crossing into the next day.8:00 (8 decimal hours)
12:00 AM as a time12:00 AMMidnight, the start of the day12-hour AM/PM handling: 12:00 AM is midnight, not noon.Parses to minute 0 of the day
12:00 PM as a time12:00 PMNoon12:00 PM is noon, not midnight.Parses to minute 720 of the day
24-hour input17:30 to 23:005.5 hours elapsed24-hour clock format, typed directly.5:30 (5.5 decimal hours)
Shorthand input815 to 1730Same as 8:15 to 17:30No separator: the last two digits are always minutes.9:15 (9.25 decimal hours)
Period-separated shorthand7.15Same as 7:15A period stands in for the colon.Parses to minute 435 of the day
Zero-minute break09:00–17:00, one 0-minute breakUnchanged: 8 hoursA zero-minute break is accepted and deducts nothing.8:00
One unpaid break09:00–17:00, one 30-minute break7.5 hours paidShift duration minus the unpaid break.7:30 (7.5 decimal hours)
Multiple breaks09:00–17:00, breaks of 15 and 30 minutes7.25 hours paidEvery unpaid break is summed and deducted.7:15 (7.25 decimal hours)
Invalid hour25:00Rejected, not guessed atA malformed time is refused, never guessed into a number.Rejected: “Hours must be 0-23.”
Invalid minutes09:75Rejected, not guessed atSame rule for the minutes component.Rejected: “Minutes must be 0-59.”
Blank/missing end timeA shift with a start time and no end timeRejected, not treated as zeroNever calculated as zero or guessed — flagged as missing.Rejected: “Shift 1 has no end time.”
Equal start and end times09:00 to 09:00 (default)Zero — treated as a typo by defaultAmbiguous by default: treated as a zero-length entry unless you say otherwise.0:00
Equal start and end, full day chosen09:00 to 09:00, “full 24-hour shift” selected24 hours, only because you chose itYou explicitly choose the full-day meaning; we never assume it.24:00
Rounding enabled09:07–17:00, rounded to the nearest 15 minutesRounded up to 8:00Paid duration only, rounded up/down/nearest as you choose.8:00
Raw vs rounded, same case09:07–17:00, rounded to the nearest 15 minutesBoth the exact and rounded figures, kept togetherRounding never discards the exact time.Worked time 7:53 (7.88h); rounded payroll time 8:00 (8h)
Decimal conversion7 hours 30 minutes7.5Minutes ÷ 60, to your chosen precision.7.5 decimal hours
Decimal conversion, reverse42.25 decimal hours42 hours 15 minutesThe same conversion, inverted.2535 minutes (42 hours 15 minutes)
Multiple shifts in one total09:00–13:00 and 14:00–18:008 hours combinedEvery shift’s paid duration is summed.8:00 (8 decimal hours)
Weekly total with overtime thresholdFive 8-hour days, threshold set to 40 hours40 hours, all regular — the threshold isn’t crossedPaid minutes split at the threshold you set; nothing above it here.40:00 total — 2400 regular minutes, 0 overtime minutes
Punch (clock-in/out) pairs8:02 AM–12:15 PM and 12:47 PM–5:09 PMBoth pairs summed, gap between them excludedEach 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