Time Calculator
Add and subtract hours, minutes and seconds, add up a list of times, or find the time between two times.
This time duration calculator finds the hours, minutes and seconds between two times, including spans that cross midnight, and can take off a break.
Time duration
8 h 30 min
8.5 hours
From 9:00 AM to 5:30 PM is 8 h 30 min, or 8.5 hours.
Write both times on the 24-hour clock
9:00 AM = 09:00; 5:30 PM = 17:30.
Subtract column by column, borrowing 60 when needed
Minutes: 30 − 0 = 30 min. Hours: 17 − 9 = 8 h.
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.
Duration between two times
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
Plain-text formula: hours = h + m/60 + s/3600
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
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.
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.
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.
| Span | Seconds | Minutes | Hours | Duration |
|---|---|---|---|---|
| 07:45 to 16:30 | – | 30 + 60 − 45 = 45 | 15 − 7 = 8 | 8 h 45 min |
| 08:50:40 to 17:15:10 | 10 + 60 − 40 = 30 | 14 + 60 − 50 = 24 | 16 − 8 = 8 | 8 h 24 min 30 s |
| 21:40 to 05:15 (+24 h) | – | 15 + 60 − 40 = 35 | 28 − 21 = 7 | 7 h 35 min |
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.
| From and to | Duration | Decimal hours | Minutes |
|---|---|---|---|
| 9:00 AM to 5:00 PM | 8 h | 8 | 480 |
| 9:00 AM to 2:00 PM | 5 h | 5 | 300 |
| 9:00 AM to 12:00 PM | 3 h | 3 | 180 |
| 8:00 AM to 5:00 PM | 9 h | 9 | 540 |
| 8:00 AM to 4:30 PM | 8 h 30 min | 8.5 | 510 |
| 8:30 AM to 5:00 PM | 8 h 30 min | 8.5 | 510 |
| 7:00 AM to 3:00 PM | 8 h | 8 | 480 |
| 7:00 AM to 7:00 PM | 12 h | 12 | 720 |
| 12:00 PM to 5:00 PM | 5 h | 5 | 300 |
| 3:00 PM to 11:00 PM | 8 h | 8 | 480 |
| 10:00 PM to 6:00 AM (next day) | 8 h | 8 | 480 |
| 11:00 PM to 7:00 AM (next day) | 8 h | 8 | 480 |
| 7:00 PM to 7:00 AM (next day) | 12 h | 12 | 720 |
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 | 24-hour | 12-hour | 24-hour |
|---|---|---|---|
| 12:00 AM | 00:00 | 12:00 PM | 12:00 |
| 1:00 AM | 01:00 | 1:00 PM | 13:00 |
| 2:00 AM | 02:00 | 2:00 PM | 14:00 |
| 3:00 AM | 03:00 | 3:00 PM | 15:00 |
| 4:00 AM | 04:00 | 4:00 PM | 16:00 |
| 5:00 AM | 05:00 | 5:00 PM | 17:00 |
| 6:00 AM | 06:00 | 6:00 PM | 18:00 |
| 7:00 AM | 07:00 | 7:00 PM | 19:00 |
| 8:00 AM | 08:00 | 8:00 PM | 20:00 |
| 9:00 AM | 09:00 | 9:00 PM | 21:00 |
| 10:00 AM | 10:00 | 10:00 PM | 22:00 |
| 11:00 AM | 11:00 | 11:00 PM | 23:00 |
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.
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.
How long is it from 8:45 AM to 5:15 PM, and how much is left after a 30-minute unpaid lunch?
Answer: From 8:45 AM to 5:15 PM is 8 h 30 min; after a 30-minute lunch, 8 hours.
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.
5 hours. 2 PM is 14:00 on the 24-hour clock, and 14 − 9 = 5. That is 300 minutes.
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.
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.
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.
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.
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.
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.
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.
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.
Add and subtract hours, minutes and seconds, add up a list of times, or find the time between two times.
Hours worked between two times minus breaks, a weekly timecard with overtime, and decimal hours for payroll.
Days between two dates (with business days), or a date plus or minus years, months, weeks and days.
How old you are in years, months and days, with totals, decimal age, your next birthday and birth weekday.
Convert between units in 40 categories with exact factors, formulas and tables.
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?