Date & Time

Time Duration Calculator

This time duration calculator finds the hours, minutes and seconds between two times, including spans that cross midnight, and can take off a break.

Try
Calculate

Taken off the duration, for example an unpaid lunch.

Show times as

Result

Time duration: 8 h 30 min

Time duration

8 h 30 min

8.5 hours

Hours, minutes, seconds (h:mm:ss)
8:30:00
Decimal hours
8.5 h
Total minutes
510 min
Total seconds
30,600 s

From 9:00 AM to 5:30 PM is 8 h 30 min, or 8.5 hours.

9:00 AM to 5:30 PM on a timeline
12 AM6 AM12 PM6 PM12 AMStart 9:00 AMEnd 5:30 PM8 h 30 min
Step-by-step working (3 steps)
  1. Write both times on the 24-hour clock

    9:00 AM = 09:00; 5:30 PM = 17:30.

  2. Subtract column by column, borrowing 60 when needed

    Minutes: 30 − 0 = 30 min. Hours: 17 − 9 = 8 h.

  3. Read the duration

    8 h 30 min = 8:30:00 = 8.5 hours (minutes ÷ 60 + seconds ÷ 3,600 added to the hours).

It also adds or subtracts a duration from a clock time and measures the time between two dates. Every result shows hours and minutes, decimal hours, total minutes and the working.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Choose Between times for the duration from one clock time to another, Add or subtract to move a clock time forward or back, or Between dates for spans longer than a day.
  2. Enter the start and end times. Your device shows them with AM/PM or on the 24-hour clock; the result follows Show times as.
  3. If the end time is earlier than the start, it is read as the next day, so 10:00 PM to 6:30 AM gives 8 h 30 min. Add a break in minutes to take it off.
  4. To add time, enter the start time and the hours, minutes and seconds to add or subtract. Values over 60 are fine, so 90 minutes works.
  5. Read the duration at the top, with h:mm:ss, decimal hours, total minutes and total seconds below it, a timeline, and the subtraction worked column by column.

Formulas

Duration between two times

duration=tend−tstart(+24 h if tend<tstart)\text{duration} = t_{\text{end}} - t_{\text{start}} \;(+\,24\text{ h if } t_{\text{end}} < t_{\text{start}})

Plain-text formula: duration = t_end − t_start (+ 24 h if t_end < t_start)

Write both times on the 24-hour clock and subtract. If the end time is earlier in the day than the start, the span crosses midnight, so add 24 hours to the end first.

Decimal hours

hours=h+m60+s3600\text{hours} = h + \frac{m}{60} + \frac{s}{3600}

Plain-text formula: hours = h + m/60 + s/3600

h, m, s
the hours, minutes and seconds of the duration

Payroll, invoices and spreadsheets want a duration as one decimal number: 8 h 30 min = 8.5 h and 7 h 45 min = 7.75 h.

Clock time plus a duration

new time=(tstart+d)mod24 h\text{new time} = (t_{\text{start}} + d) \bmod 24\text{ h}

Plain-text formula: new time = (t_start + d) mod 24 h

Add the duration in seconds, then remove whole days of 86,400 seconds. Each day removed moves the answer one calendar day later; a subtraction that goes below midnight lands on the day before.

Reading the result

The main result is in hours and minutes, never with more than 59 minutes or 59 seconds. Long spans keep all their hours together in the h:mm:ss line, so 26 hours shows as 26:00:00.

Decimal hours are not the same as hours and minutes: 8.30 hours is 8 h 18 min, not 8 h 30 min. Use decimal hours when multiplying by an hourly rate or entering time into payroll software. The hours to minutes converter turns any decimal hours into hours and minutes.

How to calculate the hours between two times

To find the time duration between two times by hand, write both on the 24-hour clock, then subtract the start from the end one column at a time: seconds, then minutes, then hours. When a column on top is smaller than the one below it, borrow 1 from the column to its left and add 60. For 7:45 AM to 4:30 PM, write 16:30 − 7:45. The 30 minutes are less than 45, so borrow an hour: 90 − 45 = 45 minutes, and 15 − 7 = 8 hours, giving 8 h 45 min.

If the end time is earlier in the day than the start, the span crosses midnight. Add 24 to the end hour before subtracting: 9:40 PM to 5:15 AM becomes 29:15 − 21:40 = 7 h 35 min. The table works three spans through; "+ 60" marks a borrow, and the column to its left is 1 smaller. The calculator shows the same working for any times you enter.

School math calls this elapsed time and often teaches it by counting up instead: go from the start to the next whole hour, then count whole hours, then the minutes left. For 7:45 AM to 4:30 PM, 7:45 to 8:00 is 15 minutes, 8:00 AM to 4:00 PM is 8 hours, and 4:00 to 4:30 is 30 minutes. Adding the pieces gives 8 h 45 min, the same answer as borrowing.

Time duration worked out by subtracting and borrowing
SpanSecondsMinutesHoursDuration
07:45 to 16:30–30 + 60 − 45 = 4515 − 7 = 88 h 45 min
08:50:40 to 17:15:1010 + 60 − 40 = 3014 + 60 − 50 = 2416 − 8 = 88 h 24 min 30 s
21:40 to 05:15 (+24 h)–15 + 60 − 40 = 3528 − 21 = 77 h 35 min

Common time spans in hours and minutes

These are the durations people look up most often, such as how many hours from 9 AM to 5 PM (8 hours) or from 9 AM to 2 PM (5 hours). Every row comes from the same code as the calculator. For hours worked across a full week with overtime, use the hours calculator.

Common start and end times and the duration between them
From and toDurationDecimal hoursMinutes
9:00 AM to 5:00 PM8 h8480
9:00 AM to 2:00 PM5 h5300
9:00 AM to 12:00 PM3 h3180
8:00 AM to 5:00 PM9 h9540
8:00 AM to 4:30 PM8 h 30 min8.5510
8:30 AM to 5:00 PM8 h 30 min8.5510
7:00 AM to 3:00 PM8 h8480
7:00 AM to 7:00 PM12 h12720
12:00 PM to 5:00 PM5 h5300
3:00 PM to 11:00 PM8 h8480
10:00 PM to 6:00 AM (next day)8 h8480
11:00 PM to 7:00 AM (next day)8 h8480
7:00 PM to 7:00 AM (next day)12 h12720

12-hour to 24-hour time conversion

Subtraction is easiest on the 24-hour clock, where hours run from 00 to 23. For 1 PM to 11 PM, add 12 to the hour, so 4:30 PM is 16:30. 12 PM (noon) stays 12:00, and 12 AM (midnight) becomes 00:00, so 12:15 AM is 00:15.

12-hour clock times and their 24-hour equivalents
12-hour24-hour12-hour24-hour
12:00 AM00:0012:00 PM12:00
1:00 AM01:001:00 PM13:00
2:00 AM02:002:00 PM14:00
3:00 AM03:003:00 PM15:00
4:00 AM04:004:00 PM16:00
5:00 AM05:005:00 PM17:00
6:00 AM06:006:00 PM18:00
7:00 AM07:007:00 PM19:00
8:00 AM08:008:00 PM20:00
9:00 AM09:009:00 PM21:00
10:00 AM10:0010:00 PM22:00
11:00 AM11:0011:00 PM23:00

Time duration between two dates

For spans longer than a day, choose Between dates. The calculator counts the calendar days between the two dates, turns them into seconds (86,400 per day), adds the difference between the clock times and splits the total back into days, hours, minutes and seconds. From Monday 8:00 AM to Wednesday 5:30 PM is 2 days 9 h 30 min, or 57.5 hours.

Leap years are counted, and the dates can be anywhere from year 1 to 9999. To count whole days, business days or add months to a date, use the date calculator.

Time duration in Excel or Google Sheets

Spreadsheets store a time as a fraction of a day, so the duration from a start time in A2 to an end time in B2 is =B2-A2, formatted as [h]:mm. When a span can cross midnight, use =MOD(B2-A2,1), which adds a day whenever the result would be negative. Multiply by 24 for decimal hours: =MOD(B2-A2,1)*24 gives 8.5 for 10:00 PM to 6:30 AM. Multiply by 1440 for total minutes.

To add a duration to a time, add it as a fraction of a day: =A2+TIME(3,30,0) adds 3 h 30 min. To add up a column of durations, use the time calculator, which totals a list of times and shows the sum in decimal hours.

Worked example

A workday with a lunch break

How long is it from 8:45 AM to 5:15 PM, and how much is left after a 30-minute unpaid lunch?

  1. Write both times on the 24-hour clock: 08:45 and 17:15.
  2. Minutes: 15 is less than 45, so borrow 1 hour: 75 − 45 = 30 minutes, leaving 16 hours.
  3. Hours: 16 − 8 = 8 hours, so the span is 8 h 30 min.
  4. Take off the break: 8 h 30 min − 30 min = 8 h, which is 8.0 decimal hours or 480 minutes.

Answer: From 8:45 AM to 5:15 PM is 8 h 30 min; after a 30-minute lunch, 8 hours.

Frequently asked questions

How many hours is 9 AM to 5 PM?

8 hours. On the 24-hour clock that is 17:00 − 9:00 = 8 h, or 480 minutes. With a 1-hour unpaid lunch, 7 hours are left.

How many hours is 9 AM to 2 PM?

5 hours. 2 PM is 14:00 on the 24-hour clock, and 14 − 9 = 5. That is 300 minutes.

How do I calculate time duration across midnight?

Add 24 hours to the end time before subtracting. From 10:00 PM to 6:30 AM, 30:30 − 22:00 = 8 h 30 min. This calculator does it for you whenever the end time is earlier than the start.

How do I convert a duration to decimal hours?

Divide the minutes by 60 and add them to the hours: 7 h 45 min = 7 + 45/60 = 7.75 hours. For seconds, divide by 3,600. Every result here shows decimal hours under the main answer.

How do I take a break off a time duration?

Find the time between the two times, then subtract the break. 8:45 AM to 5:15 PM is 8 h 30 min, and minus a 30-minute lunch that is 8 h. Enter the break in minutes and the calculator takes it off.

How many minutes are between two times?

Work out the duration, then multiply the hours by 60 and add the minutes. 9:15 AM to 11:50 AM is 2 h 35 min, which is 2 × 60 + 35 = 155 minutes. The total minutes line shows this for every result.

How do I add hours and minutes to a time?

Add the minutes first; if they reach 60, carry 1 hour. 9:45 AM + 3 h 30 min: 45 + 30 = 75 minutes = 1 h 15 min, and 9 + 3 + 1 = 13, so the answer is 13:15, or 1:15 PM. Past 24:00, the answer moves to the next day.

How do I find the time duration between two dates?

Choose Between dates and enter both dates and times. Monday 8:00 AM to Wednesday 5:30 PM is 2 days 9 h 30 min, or 57.5 hours.

How do I calculate time duration in Excel?

Subtract the start cell from the end cell and format the result as [h]:mm. Use =MOD(B2-A2,1) when the span can cross midnight, and multiply by 24 to get decimal hours.

Does daylight saving time change the result?

No. Times are clock times without a time zone, and every day is 24 hours. If a clock change happens inside your span, the real elapsed time is one hour more or less.

Time Calculator

Add and subtract hours, minutes and seconds, add up a list of times, or find the time between two times.

Date & Time

Hours Calculator

Hours worked between two times minus breaks, a weekly timecard with overtime, and decimal hours for payroll.

Date & Time

Date Calculator

Days between two dates (with business days), or a date plus or minus years, months, weeks and days.

Date & Time

Age Calculator

How old you are in years, months and days, with totals, decimal age, your next birthday and birth weekday.

Date & Time

Unit Converter

Convert between units in 40 categories with exact factors, formulas and tables.

Tools

Sources and further reading

  1. The International System of Units (SI Brochure), 9th ed., Table 8: non-SI units accepted for use with the SI (minute, hour, day) (opens in a new tab), Bureau International des Poids et Mesures
  2. ISO 8601: Date and time format (opens in a new tab), International Organization for Standardization
  3. Add or subtract time in Excel (opens in a new tab), Microsoft Support

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?