Sexagesimal Time Arithmetic Explained
Because time is measured using the sexagesimal (base-60) system for minutes and seconds rather than standard base-10 decimal notation, adding and subtracting time spans requires modular base-60 conversions.
Algorithm
- Convert all timestamps into total cumulative seconds: $\text{Seconds} = (\text{Hours} \times 3600) + (\text{Minutes} \times 60) + \text{Seconds}$.
- Perform standard integer addition or subtraction on the seconds total.
- Convert the resulting seconds back into canonical units: $\text{Hours} = \lfloor \text{Total} / 3600 \rfloor$, $\text{Minutes} = \lfloor (\text{Total} \pmod{3600}) / 60 \rfloor$, $\text{Seconds} = \text{Total} \pmod{60}$.