Date Duration Calculator

Find the exact time between two dates and times, such as the length of a trip or a project. You get the duration in years, months, days, hours and minutes, and the same span as a total number of days, hours, minutes or seconds.

Pick a start and an end date and time.

How DateMath measures a duration

DateMath counts the whole calendar months that fit between the start and the end first, then the remaining days, hours and minutes, so adding the result back to the start lands exactly on the end. The totals in days, hours, minutes and seconds measure the same span in clock time, without a time zone.

It follows the Gregorian calendar. Their rules and sources, and how DateMath tests its results, are on the About page.

Working out a duration by hand

For Wednesday, January 20, 2027, 6:00 PM to Thursday, April 15, 2027, 9:30 AM:

  1. Whole months. 3 months after the start would be Tuesday, April 20, 2027, 6:00 PM, past the end, so 2 months fit, reaching Saturday, March 20, 2027, 6:00 PM.
  2. Whole days. 25 days more reach Wednesday, April 14, 2027, 6:00 PM.
  3. The time left, under a day: 15 hours, 30 minutes.

The duration is 2 months, 25 days, 15 hours, 30 minutes, or 84.65 days, 2,031.5 hours as one total. Use the totals for a timesheet or a billing period and the headline to say the span in words.

Month ends and leap days

A month counts when adding it to the start doesn't pass the end, and a month from the 31st ends on a shorter month's last day.

  • January 31, 2027 to February 28, 20271 month (28 days)
  • February 28, 2027 to March 31, 20271 month, 3 days (31 days)
  • January 31, 2028 to February 29, 20281 month (29 days)
  • February 29, 2028 to February 28, 20291 year (365 days)

Clock changes, midnight and spans that run backward

Both times are clock times in one time zone, so the hour the clocks jump isn't added or removed: from Saturday, March 13, 2027, 10:00 PM to Sunday, March 14, 2027, 6:00 AM shows 8 hours, while only 7 hours pass in most of the US that night. For the end of a day, enter 12:00 AM on the next day, as 24:00 isn't accepted. An end before the start gives a negative duration with a minus sign; the totals show its size.

To add a duration to a date instead, use the time calculator; for days between dates with business days, the date calculator.

Frequently asked questions

How do I calculate the duration between two dates and times?
Enter the start and the end date and time; the calculator subtracts the start from the end as you type. It counts the whole calendar months that fit first, then the remaining days, hours and minutes, and also shows the span as total days, hours, minutes and seconds. Adding the result back to the start lands exactly on the end.
Can I add a duration to a date with this calculator?
No, it measures the time between two dates and times. To add or subtract days, weeks, months or years from a date, use the date calculator; to add days, hours, minutes and seconds to a date and time, use the time calculator.
Can I count just the days between two dates?
Yes. Set both times to midnight and read the "Total days" line; it counts the days after the start date up to and including the end date. To count both the first and the last day, set the end to midnight on the day after the last day.
How many hours are there between two dates?
Multiply the whole days by 24 and add the hours left over; the calculator does this for you in the "Total hours" line. For example, from 9:00 AM on one day to 5:30 PM the next day is 32.5 hours.
Why is January 31 to February 28 one month?
Because one month after January 31 is the last day of February, the same rule used when adding months to a date. The calculator counts a month whenever adding it to the start does not pass the end, so adding the result back always gives the end date. In a leap year, January 31 to February 28 is 28 days, and January 31 to February 29 is one month.
Why is the month count different from the day count divided by 30?
Because months have 28 to 31 days. The calculator counts calendar months (January 15 to February 15 is one month, whatever its length) and gives the rest in days, so the result matches the calendar rather than an average month.
Does it account for daylight saving time?
No. Both times are treated as clock times in the same time zone, so a daylight saving change between them is not added or removed. Across a spring-forward night the real elapsed time is one hour shorter than shown, across a fall-back night one hour longer.
What happens if the end is before the start?
You get a negative duration: the result starts with a minus sign and a note says the end is before the start. The totals in days, hours, minutes and seconds show the size of the span without the sign.
How do I enter midnight at the end of a day?
Enter 12:00 AM (00:00) on the next day; 24:00 is not accepted. For example, 9:00 AM to 12:00 AM the next morning is 15 hours. The time fields take hours and minutes, not seconds.