Time Calculator
With days 0 days, hours 3 hours, minutes 45 minutes, seconds 0 seconds and 4 more fields, time comes to 6:05:30 — result. It is reached in 13 steps, the last of which is 1 * (13500 + 8430) + 0 * (13500 - 8430) + 0 * (13500 * 3) + 0 * (13500 / (3 + 1 - 0)), and each one is printed on the page with its numbers filled in. The formula is the one published by BIPM SI Brochure, not an approximation fitted to it.
Add, subtract, multiply or divide durations in days, hours, minutes and seconds, with the decimal hours payroll and billing want.
Formula and sources checked · How we check
Operation Add the two durations, Hours 3 hours, Minutes 45 minutes, Hours 2 hours
6:05:30
Result for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.
It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.
- First duration in seconds
0 * 86400 + 3 * 3600 + 45 * 60 + 013,500 s- Second duration in seconds
0 * 86400 + 2 * 3600 + 20 * 60 + 308,430 s- Result in seconds
1 * (13500 + 8430) + 0 * (13500 - 8430) + 0 * (13500 * 3) + 0 * (13500 / (3 + 1 - 0))21,930 s- As a clock reading
6:05:30- Whole days
fix(abs(21930) / 86400) * sign(21930)0 days- Hours past the day
floor(mod(abs(21930), 86400) / 3600)6 hours- Minutes past the hour
floor(mod(abs(21930), 3600) / 60)5 minutes- Seconds past the minute
mod(abs(21930), 60)30 seconds- Decimal hours
21930 / 36006.092 hours- Total minutes
21930 / 60365.5 minutes- Total days
21930 / 864000.254 days- Total weeks
21930 / 6048000.036 weeks- Times the second fits into the first
13500 / 84301.601
Worked example
3:45:00 plus 2:20:30 is 6:05:30, because 45 and 20 minutes carry an hour between them. In decimal hours that is 6.0917, and a timesheet reading 6.05 would be short by four minutes on this one entry.
How to work it out yourself
- 1.Enter each duration in days, hours, minutes and seconds. Leave a field at zero rather than converting it yourself.
- 2.Time carries in sixties, not tens, which is why adding 45 and 20 minutes gives 1:05 and not 65. Converting to seconds first and back at the end removes the carry entirely.
- 3.Multiply to price a repeated job and divide to split one between people. The factor is a count, not a duration.
- 4.Read the decimal hours line before typing anything into payroll or an invoice. 6:05 is 6.0833 hours, not 6.05, and the difference compounds over a month.
The formula
- First duration in seconds
0 * 86400 + 3 * 3600 + 45 * 60 + 0 - Second duration in seconds
0 * 86400 + 2 * 3600 + 20 * 60 + 30 - Result in seconds
1 * (13500 + 8430) + 0 * (13500 - 8430) + 0 * (13500 * 3) + 0 * (13500 / (3 + 1 - 0)) - As a clock reading
- Whole days
fix(abs(21930) / 86400) * sign(21930) - Hours past the day
floor(mod(abs(21930), 86400) / 3600) - Minutes past the hour
floor(mod(abs(21930), 3600) / 60) - Seconds past the minute
mod(abs(21930), 60) - Decimal hours
21930 / 3600 - Total minutes
21930 / 60 - Total days
21930 / 86400 - Total weeks
21930 / 604800 - Times the second fits into the first
13500 / 8430
Source: BIPM SI Brochure — the second, and units accepted for use with the SI, US Department of Labor, 29 CFR 785.48 — recording and rounding working time
Questions people actually ask
- Why is 6:05 not 6.05 hours?
- Because minutes are sixtieths of an hour, not hundredths. Five minutes is 5/60 of an hour, which is 0.0833, so 6:05 is 6.0833 hours. Reading the clock straight into a decimal field understates every entry whose minutes are under 60 and is the commonest timesheet error there is.
- Can the result be negative?
- Yes, and it is shown as one. Subtracting a longer duration from a shorter one is a real question — how much short a session ran, how far past a budget — and hiding the sign would turn a deficit into a surplus.
- How do I divide one duration by another?
- You do not have to switch anything: the ratio of the two durations you entered is printed with every addition and subtraction. It answers how many of the second fit into the first, which is how many sessions fit in an afternoon or how many times one lap goes into a race.
- How is this different from the hours worked calculator?
- That one takes clock-in and clock-out times, handles a break and applies a rounding policy, which is a timesheet. This one adds, subtracts, multiplies and divides bare durations, which is what you want for stacking session lengths, splitting a budget, or checking a total.
- Does it handle durations over 24 hours?
- Yes, and days are a field of their own rather than something to convert by hand. The clock reading keeps counting rather than wrapping, so 30 hours reads as 30:00:00 and not 6:00:00, and the days, weeks and decimal lines are there when those are the more useful shape.
Related
- Hours CalculatorHours worked between two times, less breaks, in decimal payroll hours — with what the federal rounding rules do to the total.
- Date CalculatorWhat date falls a given number of days or weeks from another date, counting calendar days or business days.
- Age CalculatorExact age in years, months and days from a birth date, plus the total days lived and the next birthday.
- Military Time ConverterA clock time as military time, with the full chart of all twenty-four hours and the two readings people get wrong: midnight and noon.
- Day CounterHow many days lie between two dates, counted as calendar days and again as working days, with the span in weeks, months and years.
- Minutes to DecimalHours and minutes as the decimal a payroll system wants, with the quarter-hour rounding the FLSA allows and what it costs you over a year.
Where this one stops
Put this calculator on your site
Free, no attribution required beyond the link.
<iframe src="https://rulecalculators.com/embed/time-calculator" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Time Calculator"></iframe>