Time duration calculator
Find the time between two times, or between two dates and times, in days, hours, minutes and seconds.
Time between two times
How it's worked out
Both moments are turned into seconds: the whole days between the two dates, plus the difference between the two clock times. The total is then split into days, hours, minutes and seconds, and also given as total hours (to two decimal places), total minutes and total seconds. Everything is counted in whole seconds, so there is no rounding drift.
Across midnight: 10:45 PM to 3:20 AM
With no dates, an end time earlier than the start is taken as the next day. From 10:45 PM to midnight is 1 hour 15 minutes, and from midnight to 3:20 AM is 3 hours 20 minutes, so the duration is 4 hours 35 minutes, or 4.58 hours.
Across several days: Monday 8:15 AM to Thursday 4:40 PM
From Monday, October 5, 2026 at 8:15 AM to Thursday, October 8, 2026 at 8:15 AM is exactly 3 days. From 8:15 AM to 4:40 PM adds 8 hours 25 minutes. The duration is 3 days 8 hours 25 minutes: 80 hours 25 minutes in total, or 80.42 hours.
Across a daylight saving change: October 31 to November 1, 2026
From Saturday, October 31, 2026 at 10:00 PM to Sunday, November 1 at 6:00 AM is 8 hours on the clock. In most of the US the clocks go back an hour at 2:00 AM that night, so 9 hours actually pass. In spring it runs the other way: on the night of March 8, 2026, 10:00 PM to 6:00 AM is 8 clock hours but only 7 real ones. The calculator shows clock time and, when you enter dates, points out a change in your own time zone.
Time duration in Excel or Google Sheets
Put the start date and time in A2 and the end in B2 (for example 10/5/2026 8:15 AM), then:
The duration, formatted as [h]:mm:ss:
=B2-A2Total hours as a decimal (format the cell as a number):
=(B2-A2)*24Total minutes:
=(B2-A2)*1440Total seconds:
=(B2-A2)*86400Days and hours as text, such as "3 days 8:25":
=INT(B2-A2)&" days "&TEXT(B2-A2,"h:mm")For times without dates that may cross midnight, use =MOD(B2-A2,1) instead of =B2-A2. Spreadsheets count clock time, so, like this calculator, they ignore daylight saving changes. These formulas work the same in Excel and Google Sheets.
Which calculator do you need?
- Time calculator: add and subtract hours, minutes and seconds, or a duration to a date and time.
- Time duration calculator: the time between two times or two dates and times.
- Hours calculator: hours worked, shifts, breaks and weekly or biweekly timesheets.
- Date duration: days, weeks and months between two dates.
Related tools
Frequently asked questions
How do I calculate the duration between two times?
Take the start time from the end time. If the minutes of the end are smaller, borrow an hour as 60 minutes. For example, 1:20 PM to 4:05 PM is 16:05 − 13:20 = 2 hours 45 minutes. The calculator does this to the second.
What if the end time is after midnight?
Leave the end date blank and an end time earlier than the start is counted on the next day: 10:45 PM to 3:20 AM is 4 hours 35 minutes, and the result is marked "Spans midnight".
How do I find the time between two dates and times?
Enter both dates as well as both times. The calculator counts the whole days between the dates, adds the difference between the clock times and shows days, hours, minutes and seconds, plus total hours. If the end is before the start, the duration is shown as negative.
Does daylight saving time change the result?
The result is clock time. On the nights the clocks change, the real elapsed time is an hour more (in autumn) or less (in spring). When you enter dates, the calculator checks your device's time zone and says if a change falls in between.
How do I calculate time duration in Excel or Google Sheets?
With the start date and time in A2 and the end in B2, =B2-A2 formatted as [h]:mm:ss gives the duration. Multiply by 24 for decimal hours, by 1,440 for minutes or by 86,400 for seconds. For times without dates that cross midnight, use =MOD(B2-A2,1).