Plenty of real questions are not about two times on one day. A project kicks off on a Monday morning and ships on Friday afternoon. A machine runs from late January into February. A warranty starts on one date and a claim lands months later at a specific hour. In each case the thing you want is the duration between two dates, with times attached, and the honest way to get it is to stop treating it as one giant subtraction.
The trick is to anchor on the start time. Move forward from the start in whole days until you land on the end date at the same clock time. Whatever is left over is a single same-day problem, and you already know how to solve those. Whole days times 24, plus the leftover hours, gives you the total in any unit you need.
The anchor method, step by step
- Write down the full start date-time and end date-time. Do not drop the times; they decide the leftover piece.
- Count the whole days from the start date to the end date at the same clock time. Each whole day is worth 24 hours.
- Look at the clock times. If the end time is later in the day than the start time, the difference is a simple subtraction and you add it on.
- If the end time is earlier in the day, take one whole day back off, then work out the stretch from the start time, through midnight, to the end time, and add that instead.
- Combine: whole days as days and hours, or multiply the days by 24 and add the leftover hours for a single total.
Step 4 is where most people go wrong. When the end clock time is earlier than the start clock time, it is tempting to borrow a day silently and end up one day short. The rule above keeps the borrowing visible: fewer whole days, plus a longer final stretch that wraps past midnight.
Example 1: a working week project
A project starts Monday, March 3 at 9:00 AM and finishes Friday, March 7 at 4:30 PM. Anchor on 9:00 AM: from March 3 at 9:00 AM to March 7 at 9:00 AM is exactly 4 whole days. The end time, 4:30 PM, is later than 9:00 AM, so the leftover is a plain subtraction: 7 hours 30 minutes. Total duration: 4 days 7 hours 30 minutes. As a single number of hours that is 4 x 24 + 7.5 = 103.5 hours, and in minutes it is 6,210. Notice the answer is not "five days" just because the project touched five calendar dates; durations measure the gap, not the count of dates.
Example 2: crossing a month boundary
A server migration starts January 28 at 2:00 PM and ends February 3 at 10:00 AM. The end clock time is earlier than the start clock time, so step 4 applies. Count whole days to February 2 at 2:00 PM instead: that is 5 whole days (January 28 to 29, 30, 31, February 1, and 2). The final stretch runs from February 2 at 2:00 PM through midnight to February 3 at 10:00 AM, which is 20 hours. Total: 5 days 20 hours, or 140 hours exactly. Sanity check the other way: six full days would be 144 hours, and the end time sits 4 hours earlier in the day than the start time, so 144 - 4 = 140. Both routes agree.
Example 3: the leap year trap
February is the one month that changes length, and it quietly adds a day to any span that crosses it in a leap year. From February 28 to March 1 in 2024 is 2 days, because 2024 is a leap year and February 29 sits in between. The same calendar dates in 2025 give only 1 day. The rule for spotting leap years: a year is a leap year if it divides by 4, except century years, which must divide by 400. So 2024 and 2028 are leap years, 2026 and 2027 are not, and 2000 was while 1900 was not. When you count whole days month by month, the only adjustment you ever need is February: 29 days in a leap year, 28 otherwise.
Month lengths you will actually need
| Month | Days | Month | Days |
|---|---|---|---|
| January | 31 | July | 31 |
| February | 28 (29 in leap years) | August | 31 |
| March | 31 | September | 30 |
| April | 30 | October | 31 |
| May | 31 | November | 30 |
| June | 30 | December | 31 |
When a span covers several months, count it month by month using this table rather than guessing an average month. An "average month" of 30.44 days is fine for rough planning, but it drifts by hours on real spans, and deadlines, billing and warranties all care about the exact figure.
Expressing the answer: days, weeks or one big number
The same duration can wear several outfits, and the right one depends on who is reading it. 140 hours is also 5 days 20 hours, or 8,400 minutes, or 5.83 days as a decimal. For anything under two days, hours and minutes read best. For multi-day spans, days plus leftover hours is clearest, because "103.5 hours" forces your reader to do the division you already did. If the total is needed for a single calculation, like a rental charge per hour or a prorated salary, give the plain total in hours as well. Splitting a mixed answer into clean units is a skill of its own, and our guide to splitting a duration into days, hours and minutes covers the division routine in detail. If all you actually need is the hour count, our guide to the hours between two dates trims this same method down to that one number.
Checking your answer
Add the duration back onto the start date-time and you must land exactly on the end. March 3 at 9:00 AM plus 4 days is March 7 at 9:00 AM; plus the leftover 7 hours 30 minutes is March 7 at 4:30 PM. January 28 at 2:00 PM plus 5 days 20 hours is February 3 at 10:00 AM. If the check lands an hour or a day away, the usual suspects are a February that was given the wrong length, a whole day borrowed twice in step 4, or a PM time that lost its 12 hours. And if your two readings are on the same day after all, the simpler clock-only version of this method is in our guide to the duration between two times.
Try it the fast way
The time duration calculator accepts full dates and times at both ends and returns the duration as days, hours, minutes and seconds, together with the totals in each unit, so multi-month spans take seconds instead of a page of counting. For adding several separate lengths of time together once you have them, the time calculator on the homepage handles lists of durations.
Frequently asked questions
How do I count the duration if I only have dates and no times?
Treat both dates as midnight at the start of the day. The duration is then a whole number of days: count the days from the first date to the second. From March 3 to March 10 is exactly 7 days. Just remember this counts the gap between the dates, so it does not include the starting day itself.
Does the duration include both the first and the last day?
A duration measures the gap, so a span from Monday 9 AM to Tuesday 9 AM is exactly 1 day even though it touches two calendar days. Some real-world counts, like hotel nights or leave days, use inclusive counting instead and add one. Decide which convention your situation uses before you compare answers.
How do leap years change the duration between two dates?
A leap year adds February 29, so any span that includes that date is one day longer. February 28 to March 1 is 2 days in 2024, a leap year, but only 1 day in 2025. When you count whole days month by month, give February 29 days in leap years and 28 in the rest.
How do I calculate the duration between two dates and times in Excel?
Enter each date and time in a single cell, then subtract the start cell from the end cell. The result is a number of days with a decimal part: 4.31 means 4 days and about 7.5 hours. Format it with [h]:mm to see total hours and minutes, or multiply by 24 for total hours as a plain number.
What if the two dates are in different time zones?
Convert both date-times into the same time zone, ideally UTC, before you subtract. A deadline set for 5 PM in New York and a submission made at 5 PM in Los Angeles are three hours apart in reality, and subtracting the local readings without converting would hide that completely.
