Time Duration Calculator

Pick the operation. Fields the operation does not use are dimmed. Results are shown as h:mm:ss, as days/hours/minutes/seconds, and as decimal hours.

Multiply or divide duration A by this number.
For example 7.75 for seven and three-quarter hours.

Result (h:mm:ss)

4:15:30

Days

0

Hours

4

Minutes

15

Seconds

30

Total seconds

15,330

Decimal hours

4.2583 h

How it works

Every duration is first turned into a single number of seconds: 60 seconds in a minute, 60 minutes in an hour, 24 hours in a day. Adding, subtracting, multiplying and dividing then work on that one number, and the answer is split back into days, hours, minutes and seconds.

You can type a duration however it comes: 90 minutes, or 1 hour 30 minutes, or 5,400 seconds all mean the same thing, and overflowing fields (75 minutes, 30 hours) are carried over automatically.

Decimal hours are what timesheets and payroll use: 7 hours 45 minutes is 7.75 hours, because 45 ÷ 60 = 0.75. The two conversion operations go between the h:mm:ss form and that decimal form in either direction.

The h:mm:ss result counts every hour, so one day and two hours shows as 26:00:00. The days/hours/minutes/seconds fields show the same duration with the days taken out.

Formula

seconds = days × 86,400 + hours × 3,600 + minutes × 60 + seconds
A + B, A − B, A × factor, A ÷ factor      (all in seconds)
days = ⌊s ÷ 86,400⌋   hours = ⌊(s mod 86,400) ÷ 3,600⌋
minutes = ⌊(s mod 3,600) ÷ 60⌋   seconds = s mod 60
decimal hours = h + m ÷ 60 + s ÷ 3,600

Example

2 h 30 min plus 1 h 45 min 30 s: 9,000 s + 6,330 s = 15,330 s, which is 4:15:30, or 4.2583 decimal hours.

7 h 30 min in decimal hours is 7 + 30 ÷ 60 = 7.5 h. Going the other way, 2.5 decimal hours is 2:30:00.

One day divided by 3 is 86,400 ÷ 3 = 28,800 s, which is 8:00:00.

Assumptions and limitations

  • A day is exactly 24 hours (86,400 s). Daylight-saving changes, leap seconds and calendar dates are not involved; use the date difference calculator for dates.
  • Subtracting a longer duration from a shorter one gives a negative result, shown with a minus sign in front of the h:mm:ss form and as negative total seconds and decimal hours. The day/hour/minute/second fields show its size.
  • Seconds are kept to the microsecond and displayed to two decimal places; the other fields are whole numbers.

Frequently asked questions

How do I convert minutes to decimal hours for a timesheet?

Divide the minutes by 60. 15 minutes is 0.25 h, 30 minutes is 0.5 h, 45 minutes is 0.75 h, and 20 minutes is 0.3333 h. Enter the hours and minutes in duration A and choose "Convert A to decimal hours".

Can I enter 90 minutes instead of 1 hour 30 minutes?

Yes. Any field can hold more than its usual limit; the calculator converts everything to seconds first, so 90 minutes and 1:30:00 give the same result.