Date & Time

Time Duration Calculator

To calculate time duration, subtract the start time from the end time. From 9:15 AM to 5:45 PM is 8 hours 30 minutes, which is 8.5 hours in decimal form. If the end time is earlier than the start time, the period runs past midnight, so add 24 hours.

Calculate the time between
minutes

Duration

—

—

Decimal hours
—
Total minutes
—
Total seconds
—
Days, hours and minutes
—
Weeks
—

—

How to use the time duration calculator

Choose what you are measuring:

  • Two times on the same day, or across midnight: a work shift, a flight, a study session or a recording. You can subtract an unpaid break, which makes it handy for timesheets.
  • Two dates and times: for longer periods such as a trip, a project, a rental or a countdown. This works as a time and date duration calculator and shows the answer in days, hours and minutes as well as total hours.

Every result is shown four ways: hours and minutes, decimal hours, total minutes and total seconds, with the working underneath.

How to calculate time duration by hand

Hours and minutes don’t follow the decimal system (an hour has 60 minutes, not 100), so the easiest method is to convert everything to minutes first:

minutes after midnight = hours × 60 + minutes duration (minutes) = end − start (add 1,440 if the end is past midnight) hours = duration ÷ 60 (whole number), minutes = what is left over

Example: 9:15 AM to 5:45 PM

  1. Start: 9 × 60 + 15 = 555 minutes. End: 17 × 60 + 45 = 1,065 minutes (5:45 PM is 17:45 on the 24-hour clock).
  2. 1,065 − 555 = 510 minutes.
  3. 510 ÷ 60 = 8 remainder 30, so 8 hours 30 minutes, or 8.5 decimal hours.
  4. With a 30-minute unpaid lunch: 510 − 30 = 480 minutes = 8 hours.

The borrowing method

You can also subtract hours and minutes directly. If the end minutes are smaller than the start minutes, “borrow” one hour as 60 minutes. For 2:10 PM − 11:40 AM: 14:10 − 11:40 → 13:70 − 11:40 = 2 hours 30 minutes.

Time duration across midnight

Night shifts and late flights finish on the next day, so the end time looks “earlier” than the start. Add 24 hours to the end time before subtracting:

10:30 PM to 6:15 AM: (6:15 + 24:00) − 22:30 = 30:15 − 22:30 = 7 hours 45 minutes, or 7.75 hours.

The calculator does this automatically whenever the end time is earlier than the start time.

Duration between two dates and times

For longer periods, count the full days and then the remaining hours and minutes. From November 20 at 8:00 AM to November 23 at 5:30 PM is 3 days, 9 hours and 30 minutes, which is 81.5 hours.

Converting to decimal hours

Payroll systems, invoices and spreadsheets usually need decimal hours. Divide the minutes by 60:

MinutesDecimal hours
6 minutes0.1
15 minutes0.25
20 minutes0.333…
30 minutes0.5
45 minutes0.75

So 7 hours 45 minutes is 7.75 hours. A common mistake is writing it as 7.45 hours, which is actually 7 hours 27 minutes.

How to calculate time duration in Excel

Excel stores times as fractions of a day, so subtraction works directly:

Hours and minutes: =B1-A1 (format the cell as [h]:mm) Decimal hours: =(B1-A1)*24 Across midnight: =MOD(B1-A1,1) (format as [h]:mm)

The square brackets in [h]:mm let Excel show durations longer than 24 hours instead of rolling back to zero. Google Sheets uses the same formulas.

Good to know

  • Daylight saving time: the calculator uses clock times and doesn’t add or remove the hour when clocks change. If a period crosses the change, adjust the result by one hour.
  • Time zones: for flights between time zones, convert both times to the same zone first.
  • Rounding at work: some employers round clock-in times, for example to the nearest quarter hour. Follow your employer’s policy for payroll.
  • Turning hours into pay: once you have your weekly total, the overtime calculator works out regular and overtime pay, and the commission calculator handles commission-based pay.

Frequently asked questions

How do you calculate time duration?

Convert both times to minutes after midnight, subtract the start from the end, then convert back to hours and minutes. 5:45 PM is 1,065 minutes and 9:15 AM is 555 minutes; 1,065 − 555 = 510 minutes = 8 hours 30 minutes.

How do I calculate time across midnight?

If the end time is earlier than the start time, add 24 hours to the end time before subtracting. From 10:30 PM to 6:15 AM: (6:15 + 24:00) − 22:30 = 7 hours 45 minutes.

How do I convert minutes to decimal hours?

Divide the minutes by 60. 30 minutes is 0.5 hours, 15 minutes is 0.25 hours and 45 minutes is 0.75 hours, so 7 hours 45 minutes is 7.75 hours. Payroll and invoicing often use decimal hours.

How do I calculate time duration in Excel?

Put the start time in A1 and the end time in B1, then use =B1-A1 and format the cell as [h]:mm. For decimal hours use =(B1-A1)*24. For shifts that cross midnight, use =MOD(B1-A1,1) so the result never goes negative.

Does the calculator handle daylight saving time?

No. It treats the times you enter as clock times and does not add or remove an hour when clocks change. If a period crosses a daylight saving change, adjust the result by one hour yourself.