How to Calculate Time Duration Between Two Times
Clock times do not subtract like normal numbers. Learn two reliable methods, how to handle midnight and multi-day periods, and how to turn hours and minutes into decimal hours for timesheets.
Working out how long something took sounds trivial until you try it with real times. A shift that starts at 8:45 and ends at 17:20, a night that runs past midnight, a weekend job that spans three days: each one invites a small mistake, and on a timesheet small mistakes turn into money. Time is awkward because it does not count in tens. There are 60 seconds in a minute, 60 minutes in an hour and 24 hours in a day, so ordinary subtraction needs a little care.
Why time math is tricky
With normal numbers, 17.20 − 8.45 = 8.75. With clock times, 17:20 − 8:45 is not 8 hours 75 minutes, and it is not 8.75 hours either. The digits after the colon are minutes, which roll over at 60, not 100. Treat a clock time like a decimal and the answer is wrong almost every time.
There are two reliable ways to do it by hand: borrowing an hour, or converting everything to minutes.
Method 1: subtract with borrowing
This is like subtracting with carries in school, except you borrow 60 minutes instead of 10.
From 8:45 to 17:20:
- Minutes first: 20 − 45 does not work, so borrow one hour from 17. That turns 17:20 into 16:80.
- Minutes: 80 − 45 = 35.
- Hours: 16 − 8 = 8.
- The duration is 8 hours 35 minutes.
The same idea works with seconds. From 13:47:12 to 15:02:05, borrow a minute for the seconds (65 − 12 = 53), then an hour for the minutes (61 − 47 = 14), and finally 14 − 13 = 1 hour. The result is 1 hour 14 minutes 53 seconds.
Method 2: convert to minutes after midnight
This method is harder to get wrong and is what a computer does.
- Turn each time into minutes after midnight: 8:45 is 8 × 60 + 45 = 525, and 17:20 is 17 × 60 + 20 = 1,040.
- Subtract: 1,040 − 525 = 515 minutes.
- Turn it back: 515 ÷ 60 = 8 remainder 35, so 8 hours 35 minutes.
Crossing midnight
A night shift from 23:10 to 07:25 gives a negative number if you subtract directly. The fix is to add a full day, 24 hours or 1,440 minutes, to the end time:
- 23:10 is 1,390 minutes; 07:25 is 445 minutes.
- 445 + 1,440 − 1,390 = 495 minutes = 8 hours 15 minutes.
An easier way to picture it: from 23:10 to midnight is 50 minutes, and from midnight to 07:25 is 7 hours 25 minutes. Together, 8 hours 15 minutes.
Durations over several days
For anything longer than a day, the date matters. Suppose a job starts on Friday, November 6, 2026 at 18:30 and ends on Monday, November 9 at 09:15.
- Friday 18:30 to Monday 18:30 is exactly 3 days, or 72 hours.
- Monday 09:15 is 9 hours 15 minutes earlier than that.
- 72:00 − 9:15 = 62 hours 45 minutes.
Without dates, you would have no way of telling a 14-hour gap from a 62-hour one. That is why it is worth entering both dates whenever a period might cross a day boundary more than once.
Decimal hours for timesheets and invoices
Payroll and billing systems usually want hours as a decimal. To convert, divide the minutes by 60:
- 8 h 35 min = 8 + 35 ÷ 60 = 8.58 hours
- 8 h 15 min = 8 + 15 ÷ 60 = 8.25 hours
- 62 h 45 min = 62.75 hours
The common mistake is to write 8 hours 35 minutes as 8.35. At 18 an hour, 8.35 hours pays 150.30, while the correct 8.58 hours (8.5833 before rounding) pays 154.50. That is 4.20 lost on a single shift, and more than 80 over a month of similar days.
A few conversions are worth remembering: 15 minutes is 0.25, 30 minutes is 0.5, 45 minutes is 0.75, and every 6 minutes is 0.1 of an hour.
Adding and subtracting time
The opposite problem is just as common: what time will it be after a certain duration?
- A meeting starts at 14:50 and lasts 95 minutes. 95 minutes is 1 hour 35 minutes, so it ends at 16:25.
- A flight lands at 01:30 after a 4 hour 45 minute trip. It left at 20:45 the previous evening.
- A 30-hour process started at 21:15 finishes at 03:15, two days later: 30 hours is one full day plus 6 hours, and 21:15 + 6 hours passes midnight.
When the result goes past midnight in either direction, always note the day change. "03:15" alone is ambiguous; "03:15, +2 days" is not.
Using the Time Duration Calculator
The Time Duration Calculator has two parts. In the first, enter a start and end time, with seconds if you need them, and optionally a start and end date. It returns the duration in hours, minutes and seconds, plus total minutes and decimal hours. If you leave the dates empty and the end is earlier than the start, it assumes the end is on the next day and tells you so. In the second part, enter a clock time and add or subtract any number of hours, minutes and seconds; the result shows the new time and how many days it moved.
Good to know
- Breaks are separate. If a shift includes an unpaid 30-minute lunch, subtract it from the result: 8 h 35 min − 30 min = 8 h 05 min, or 8.08 hours.
- 24:00 and 00:00. Midnight at the end of a day is the same moment as 00:00 at the start of the next. Use dates if a period ends exactly at midnight.
- Clock changes. On the nights when daylight saving time starts or ends, the real elapsed time is one hour less or more than the clock difference. Simple duration math, including the calculator's, treats every day as 24 hours.
- AM and PM. In 12-hour time, 12:30 AM is just after midnight and 12:30 PM is just after noon. Converting to 24-hour time first avoids mix-ups.
FAQ
How do I add up a week of shifts?
Convert each shift to minutes, add them, then divide by 60 for hours. Adding hours and minutes separately also works, but carry every 60 minutes over to the hours column.
How do I round time for payroll?
Rules vary by employer and location. Some round to the nearest 15 minutes, others pay to the minute. Calculate the exact duration first, then apply whatever rounding rule you are required to use.
What is the difference between elapsed time and clock time?
Clock time is a point in the day, such as 14:50. Elapsed time is the length between two points, such as 1 hour 35 minutes. Elapsed time can be longer than 24 hours; clock time cannot.
Why does my phone say a different trip length?
Travel times across time zones mix two clocks. Convert both times to the same time zone before subtracting, or the result will be off by the time difference.