What this calculator does
The Time Arithmetic Calculator lets you do math on lengths of time expressed in days, hours, minutes and seconds. You can add two time spans, subtract one from another, multiply a span by a plain number, divide a span by a plain number, or divide one span by another to get a unitless ratio. The answer is automatically normalized back into clean days, hours, minutes and seconds.
How to use it
Enter your first time span in the Operand 1 fields. Pick an operation. If you chose add, subtract, or divide-by-time, fill in the Operand 2 time fields. If you chose multiply or divide-by-a-number, fill in the single "number" field instead. Blank fields count as zero, decimals are allowed, and negative components are accepted (a subtraction can yield a negative duration, shown with a leading minus sign).
The formula
Every span is converted to total seconds using fixed civil-day lengths: 1 day = 86400 s, 1 hour = 3600 s, 1 minute = 60 s. The chosen operation is applied in seconds, then the result is broken back down by repeatedly taking whole days, then hours, then minutes, leaving any remaining seconds (which may be fractional if your inputs were). Divide-by-time simply returns A divided by B as a pure number.
$$S = d\times86400 + h\times3600 + m\times60 + s$$$$d=\lfloor S/86400\rfloor,\ h=\lfloor (S\bmod 86400)/3600\rfloor,\ m=\lfloor (S\bmod 3600)/60\rfloor,\ s=S\bmod 60$$
Worked example
Add 1 day 5 h 30 m to 20 h 45 m 30 s. First span = 106200 s, second = 74730 s, total = 180930 s. Normalizing: 2 days (172800 s) leaves 8130 s, which is 2 hours (7200 s), then 15 minutes (900 s), then 30 seconds. Result: 2 days, 2 hours, 15 minutes, 30 seconds.
$$180930 = 172800 + 8130,\quad 8130 = 7200 + 900 + 30$$
FAQ
Does it account for daylight saving or leap seconds? No. These are abstract durations, not calendar dates, so a day is always exactly 24 hours.
What happens if I divide by zero? Division by a zero number, or dividing by a zero-length time span, is undefined, so the calculator shows an error instead of a result.
Can the result be negative? Yes. Subtracting a larger span from a smaller one (or using negative inputs) produces a negative duration, displayed with a single leading minus sign.