Calculation methodology

How Work Hours Hub calculates the answer.

The formulas, edge cases, and assumptions used by the current calculators, written so you can check the math yourself.

Last updated August 13, 2026

The core calculators use shared browser-side functions for time parsing, overnight shifts, rounding, overtime splits, decimal conversion, and business-day rules. Results are deterministic: the same inputs and settings produce the same calculation.

Elapsed clock time

Start and end times are converted to seconds or minutes from midnight. If the end is earlier than the start, one day is added to the end, treating the interval as an overnight span. A same-time start and end is zero elapsed time, not an assumed 24-hour span.

elapsed = end − start; if elapsed < 0, elapsed += 24 hours

Unpaid breaks

Break time is subtracted after elapsed time is calculated. A break cannot be negative or longer than the elapsed shift/duration.

paid time = elapsed time − unpaid break

Shift rounding

When rounding is enabled, each paid shift is rounded to the nearest selected increment before it is added to the weekly total. No rounding is applied when the setting is off.

rounded minutes = round(paid minutes ÷ increment) × increment

Decimal hours

Minutes are fractions of 60 and seconds are fractions of 3,600. Decimal hours are not written like clock minutes: 7:30 is 7.50 hours, not 7.30 hours.

decimal hours = hours + minutes/60 + seconds/3600

Regular and overtime hours

The calculator uses the threshold and multiplier entered by the user. It does not decide which threshold or multiplier legally applies.

regular = min(total, threshold); overtime = max(0, total − threshold)

Optional double-time

If a double-time threshold is supplied, hours above that threshold are separated from ordinary overtime and multiplied by the separate double-time multiplier.

Business-day counting

Dates are evaluated one calendar day at a time. User-selected non-working weekdays are excluded first, then custom excluded dates. Start and end boundaries can be included or excluded independently.

Adding or subtracting business days

The calculator moves one calendar day at a time in the requested direction and decreases the remaining business-day count only on dates that are neither selected non-working weekdays nor custom exclusions.

Automated test coverage

The current core suite contains 19 automated tests. They cover valid time parsing, same-day and overnight shifts, break subtraction, rounding, payroll-style formatting, overtime splits, optional double-time, decimal conversion in both directions, business-day boundaries, custom weekends, excluded dates, and adding business days.

Time edge cases

Overnight shifts and durations are tested so an end time earlier than the start time crosses midnight instead of becoming a negative duration.

Business-day edge cases

Tests cover standard and custom weekends, boundary inclusion, custom excluded dates, and moving across non-working days.

Important limitations

Does the overtime calculator determine the law that applies?

No. Thresholds and multipliers are user inputs. The result is arithmetic based on those settings, not a legal determination.

Does the business-day calculator know every public holiday?

No. The current build intentionally uses user-entered excluded dates instead of pretending a single holiday calendar applies to every country, employer, court, bank, carrier, or contract.

Are calculator entries sent to a server to get the answer?

The core calculation logic runs in the browser. The Time Card Calculator can save its fields in browser local storage. Privacy-minimized diagnostics do not include form values or calculated results.

For the practical explanation attached to a particular calculator, use the worked examples on each tool page. For site background and operating principles, see About Work Hours Hub.