1. Base-60 (Sexagesimal) Clock Arithmetic

Unlike standard base-10 decimal mathematics, time arithmetic operates across dual radix systems: base-60 (60 seconds per minute, 60 minutes per hour) and base-24 (24 hours per calendar day). Experience this on our flagship Time Duration Calculator and Multi-Row Time Calculator.

To eliminate intermediate rounding errors, all duration and arithmetic operations convert input timestamps into integer total seconds from midnight (S):

S = (Hours × 3,600) + (Minutes × 60) + Seconds

When subtracting a start timestamp (S₁) from an end timestamp (S₂), the raw difference (ΔS) is computed:

ΔS = S₂ - S₁ - (BreakMinutes × 60)

2. Cross-Midnight & Overnight Handling (Modulo 24)

When an end time is numerically smaller than the start time (for example, starting at 10:00 PM and finishing at 6:30 AM the following morning), the elapsed time has crossed the midnight boundary (00:00). Test cross-midnight calculation on our Hours Calculator or Time Between Two Times Tool.

In modular arithmetic, the cross-midnight duration is handled by adding exactly one 24-hour cycle (86,400 seconds or 1,440 minutes):

If ΔS < 0: ΔS_adjusted = ΔS + 86,400 seconds (or 1,440 minutes)

The resulting seconds are then partitioned back into whole hours, remainder minutes, and leftover seconds using integer division and modulo:

  • Hours: Hours = floor(ΔS / 3,600)
  • Minutes: Minutes = floor((ΔS % 3,600) / 60)
  • Seconds: Seconds = ΔS % 60

3. Decimal Hours Transformation

Accounting and payroll software (ADP, QuickBooks, Paychex) require time to be represented in base-10 decimal hours so standard hourly wage multiplication can occur. Convert times directly on our Decimal Hours Calculator or compute shift wages with the Work Hours Calculator.

Decimal Hours = Hours + (Minutes / 60) + (Seconds / 3,600)

For example:

  • 7 hours 15 minutes = 7 + (15 / 60) = 7.2500 decimal hours
  • 7 hours 30 minutes = 7 + (30 / 60) = 7.5000 decimal hours
  • 7 hours 45 minutes = 7 + (45 / 60) = 7.7500 decimal hours

4. FLSA 7-Minute Rounding Rule (29 CFR § 785.48)

Under United States Department of Labor regulations (29 CFR § 785.48(b)), employers may round employee punch times to the nearest 15-minute quarter hour (0.25h). Use our Minutes to Decimal Conversion Chart to lookup statutory rounding brackets:

Clock Minute Range Quarter-Hour Mark Decimal Hour Fraction Rounding Direction
:00 to :07:000.00Rounds Down
:08 to :22:150.25Rounds Up (:08-:14) / Down (:16-:22)
:23 to :37:300.50Rounds Up (:23-:29) / Down (:31-:37)
:38 to :52:450.75Rounds Up (:38-:44) / Down (:46-:52)
:53 to :59:00 (Next Hour)1.00Rounds Up

5. Automated Test Suites & Validation Standards

Every mathematical routine is maintained under automated regression testing (npm test). Tests cover:

  • Overnight boundary transitions: Cross-midnight shifts spanning 23:59 to 00:01.
  • Noon / Midnight disambiguation: Ensuring 12:00 AM evaluates to 00:00 and 12:00 PM evaluates to 12:00.
  • Floating-point epsilon checks: Ensuring decimal additions like 0.1 + 0.2 evaluate cleanly without JavaScript IEEE 754 precision artifacts.