Date Duration Calculator
This free date and time difference calculator finds the exact time between two dates and times. 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 to use the date duration calculator
- 1
Enter the start
Pick the date and time the period begins.
- 2
Enter the end
Pick the date and time it ends. It may be in the past or the future.
- 3
Read the duration
See the duration broken down and as totals; copy the link to share it.
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.
- The Gregorian calendar. DateMath treats every date as a Gregorian date, with its leap-year rule: a year divisible by 4 is a leap year, except century years not divisible by 400, so 2000 had a February 29 and 2100 will not. Source: Gregorian calendar.
DateMath's date math is tested against more than 100 cases worked out by hand. Every worked example and table on the site is computed with the same code the calculators run, so a page and its calculator can't disagree.
How the date and time duration is calculated
DateMath subtracts the start from the end and states the difference the way a calendar does: first the whole months that fit (shown as years and months), then the whole days left, then the hours and minutes. Adding that result back to the start always lands exactly on the end. Here is the same method by hand, for Wednesday, January 20, 2027, 6:00 PM to Thursday, April 15, 2027, 9:30 AM:
- Count the whole months. A month later is the same day number in the next month, at the same time. 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.
- Count the whole days left. 25 days more reach Wednesday, April 14, 2027, 6:00 PM.
- Add the time that remains. It is less than a day: 15 hours, 30 minutes.
- Put it together: 2 months, 25 days, 15 hours, 30 minutes.
Totals in days, hours, minutes and seconds
Below the headline the calculator gives the same span without months: as days and time, and as a total number of days, hours, minutes and seconds (days and hours to two decimals). For the example above that is 84.65 days or 2,031.5 hours. Use a total when you need one number, for a timesheet, a billing period or a countdown; use the headline to say the span in words.
Duration examples
Whole calendar months are counted first, then the remaining days, hours and minutes. When the end time of day is earlier than the start time, the last day is not complete and is counted as hours.
- Monday, March 1, 2027, 9:00 AM to Wednesday, March 3, 2027, 5:30 PM2 days, 8 hours, 30 minutes (56.5 hours)
- Monday, March 1, 2027, 6:00 PM to Wednesday, March 3, 2027, 9:00 AM1 day, 15 hours (39 hours)
- Friday, January 15, 2027, 8:00 AM to Tuesday, April 20, 2027, 12:45 PM3 months, 5 days, 4 hours, 45 minutes (2,284.75 hours)
- Thursday, December 31, 2026, 10:00 PM to Friday, January 1, 2027, 6:15 AM8 hours, 15 minutes (8.25 hours)
Days between two dates
To use it as a date duration calculator for days between dates, set both times to the same clock time, such as midnight; the Total days line then shows a whole number. The count is the difference between the dates: the start day is not counted, the end day is. To count both the first and the last day, for example for an event that includes both, set the end to midnight at the start of the day after the last day.
| Span | From and to | Duration | Total days |
|---|---|---|---|
| Monday to Friday | Monday, March 1, 2027, 12:00 AM to Friday, March 5, 2027, 12:00 AM | 4 days | 4 |
| Monday through Friday, both days counted | Monday, March 1, 2027, 12:00 AM to Saturday, March 6, 2027, 12:00 AM | 5 days | 5 |
| New Year's Day to Christmas Day | Friday, January 1, 2027, 12:00 AM to Saturday, December 25, 2027, 12:00 AM | 11 months, 24 days | 358 |
| A year that includes a leap day | Tuesday, June 15, 2027, 12:00 AM to Thursday, June 15, 2028, 12:00 AM | 1 year | 366 |
The date calculator counts the days between two dates without times, has a checkbox to count both the start and the end date, and also shows the business days in the span.
Hours between two dates: common spans
The Total hours line answers how many hours lie between two dates and times: the whole days times 24, plus the hours and minutes left over. These common spans are measured with the calculator:
| Span | From and to | Duration | Total hours |
|---|---|---|---|
| Day shift | Tuesday, March 2, 2027, 8:00 AM to Tuesday, March 2, 2027, 4:30 PM | 8 hours, 30 minutes | 8.5 |
| Night shift | Tuesday, March 2, 2027, 10:00 PM to Wednesday, March 3, 2027, 6:00 AM | 8 hours | 8 |
| Weekend, Friday evening to Monday morning | Friday, March 5, 2027, 5:00 PM to Monday, March 8, 2027, 9:00 AM | 2 days, 16 hours | 64 |
| First quarter | Friday, January 1, 2027, 12:00 AM to Thursday, April 1, 2027, 12:00 AM | 3 months | 2,160 |
| A common year | Friday, January 1, 2027, 12:00 AM to Saturday, January 1, 2028, 12:00 AM | 1 year | 8,760 |
| A leap year | Saturday, January 1, 2028, 12:00 AM to Monday, January 1, 2029, 12:00 AM | 1 year | 8,784 |
Month ends and leap days
A month counts when adding it to the start does not pass the end. A month from a day the end month does not have ends on that month's last day, so a span to the last day of a shorter month can be a whole month. February 29 adds a day only to spans that include it.
- January 31, 2027 to February 28, 20271 month (28 days)
- January 31, 2027 to March 1, 20271 month, 1 day (29 days)
- February 28, 2027 to March 31, 20271 month, 3 days (31 days)
- January 31, 2028 to February 28, 202828 days
- January 31, 2028 to February 29, 20281 month (29 days)
- February 29, 2028 to February 28, 20291 year (365 days)
- February 29, 2028 to March 1, 20291 year, 1 day (366 days)
Daylight saving time, midnight and negative durations
Daylight saving time is not applied
Both times are clock times without a time zone, so the calculator never adds or removes the hour the clocks jump. From Saturday, March 13, 2027, 10:00 PM to Sunday, March 14, 2027, 6:00 AM it shows 8 hours; in most of the US the clocks spring forward that night, so only 7 hours really pass. Across the fall-back night, Saturday, November 6, 2027, 10:00 PM to Sunday, November 7, 2027, 6:00 AM also shows 8 hours, while 9 hours pass. For a span across one of these nights, correct the total by that hour yourself.
Time zones
Both times are read in the same time zone. For a flight or a call between zones, convert one of the times to the other zone first.
Midnight, 24:00 and seconds
The time fields run from midnight (12:00 AM, or 00:00 on a 24-hour clock) to 11:59 PM; 24:00 is not accepted. To mean the end of a day, enter midnight of the next day: Monday, March 1, 2027, 9:00 AM to Tuesday, March 2, 2027, 12:00 AM is 15 hours. Times are entered to the minute, so the totals are whole minutes and the seconds total is a whole number of minutes in seconds.
When the end is before the start
You get a negative duration: the headline starts with a minus sign, and a note says the end is before the start. The totals show the size of the span without the sign. Wednesday, March 10, 2027, 12:00 PM to Monday, March 8, 2027, 9:00 AM is −2 days, 3 hours (51 hours).
Days, hours, minutes and seconds: quick reference
| Span | Hours | Minutes | Seconds |
|---|---|---|---|
| 1 hour | 1 | 60 | 3,600 |
| 1 day | 24 | 1,440 | 86,400 |
| 1 week | 168 | 10,080 | 604,800 |
| February 2027 (28 days) | 672 | 40,320 | 2,419,200 |
| February 2028 (29 days) | 696 | 41,760 | 2,505,600 |
| April 2027 (30 days) | 720 | 43,200 | 2,592,000 |
| January 2027 (31 days) | 744 | 44,640 | 2,678,400 |
| 2027 (365 days) | 8,760 | 525,600 | 31,536,000 |
| 2028, a leap year (366 days) | 8,784 | 527,040 | 31,622,400 |
Adding a duration to a date, and other uses
This calculator measures the time between two dates and times; it does not add a duration to a date. To go the other way, from a start and a duration to the end, use the date calculator to add days, weeks, months or years to a date, or the time calculator to add days, hours, minutes and seconds to a date and time.
What people measure with it
- Shift and timesheet hours, including overnight shifts: read Total hours. Without dates, the hours calculator takes just the two clock times, and the time card calculator adds up a week.
- Project, contract or rental periods in months and days.
- How long until an event, or how long ago something happened, to the minute.
- The elapsed time between two timestamps, such as two log entries.
For neighboring questions: exact age is in the age calculator, working days without weekends and holidays in the business days calculator, and the week a date falls in in the week number 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 the duration calculator 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.