How the time calculator works
Time does not add in base 10. Sixty seconds make a minute, sixty minutes an hour, and twenty-four hours a day, so adding two durations means carrying at each of those boundaries. The simplest reliable method, and the one this calculator uses, is to convert everything to seconds, do ordinary arithmetic, and convert back:
seconds = days x 86,400 + hours x 3,600 + minutes x 60 + seconds days = floor(total / 86,400), then hours from the remainder, and so on
Worked example: adding
Add 1 day 2 h 30 m 15 s to 23 h 45 m 50 s, the defaults in the form:
A = 86,400 + 7,200 + 1,800 + 15 = 95,415 s B = 82,800 + 2,700 + 50 = 85,550 s A + B = 180,965 s 180,965 / 86,400 = 2 days, remainder 8,165 s 8,165 / 3,600 = 2 hours, remainder 965 s 965 / 60 = 16 minutes, remainder 5 s result = 2 days, 2 h, 16 m, 5 s
As totals, that is 2.09 days, 50.27 hours, 3,016.08 minutes, or 180,965 seconds.
Worked example: subtracting
A minus B is 95,415 - 85,550 = 9,865 s, which is 2 h 44 m 25 s. B minus A is the same magnitude with a negative sign. The calculator never shows negative minutes inside an otherwise positive result; it flags the whole duration as negative instead.
Adding a duration to a clock time
Switch to the clock mode to answer questions like "if I start at 9:30 AM and the process takes 1 day 2 h 30 m 15 s, when does it finish?" The start time becomes seconds since midnight (9:30 AM is 34,200 s), the duration is added, and every full 86,400 s carries into a day: 34,200 + 95,415 = 129,615 s, which is 1 day plus 43,215 s, or 12:00:15 PM the next day. Subtracting works the same way and can roll back past midnight into the previous day.
Unit conversion reference
| Unit | Seconds | Minutes | Hours |
|---|---|---|---|
| 1 minute | 60 | 1 | 0.01667 |
| 1 hour | 3,600 | 60 | 1 |
| 1 day | 86,400 | 1,440 | 24 |
| 1 week | 604,800 | 10,080 | 168 |
| 30-day month | 2,592,000 | 43,200 | 720 |
| 365-day year | 31,536,000 | 525,600 | 8,760 |
For payroll-style hours between a start and end time with breaks, use the hours calculator. For spans measured in calendar days, weeks, and months, use the date calculator.