How to calculate the difference between two dates
The difference between two dates is the number of calendar days from a start date to an end date. It can also be expressed as complete weeks, a calendar span in years and months, or equivalent hours and minutes. The right way to count depends on whether you need elapsed time or an inclusive count of all dates in a range.
Counting elapsed days between dates
Elapsed days measure the distance between two calendar dates. January 1 to January 2 is one day. January 1 to January 1 is zero days, because no calendar day has elapsed. A date-only calculation compares the dates at the same time of day rather than measuring from a specific clock time.
In the count above, the default day range includes the start date and excludes the end date. This matters when classifying weekdays and weekends. For example, Friday to Monday covers Friday, Saturday and Sunday: three elapsed days, one weekday and two weekend days.
Including both the start date and end date
An inclusive date count includes every date in the range, including both endpoints. Add one to the elapsed day difference. January 1 through January 2 contains two dates. A range that begins and ends on January 1 contains one date.
Inclusive counting is useful when you need the number of dates covered by a period rather than how much time has elapsed. Including both endpoints would also add the end date to the weekday and weekend counts. The calendar span remains the actual interval between the selected dates; it does not add an extra day to the years-and-months breakdown.
Date difference in years, months and days
A calendar span counts complete months from the start date, groups every 12 complete months into a year, and then counts the remaining days. Calendar months are not fixed periods of 30 days, and years are not always 365 days.
Month-end calculations need a consistent convention. Here, a date that does not exist in the target month is moved to that month's last valid day. January 31 to February 28 in a common year is therefore one complete calendar month. January 31 to March 1 in that year is one month and one day.
Adding months is anchored to the original start date. For example, two months after January 31 is March 31, rather than March 28. This avoids progressively losing days when intermediate months are shorter.
Examples of days between two dates
January 1 to January 31, 2026: 30 elapsed days, or four weeks and two days. Including both dates gives 31 dates.
February 28 to March 1, 2024: two elapsed days because February 29 falls between those dates. In 2025, the same month-and-day range is one elapsed day.
January 15, 2025 to March 20, 2026: a calendar span of one year, two months and five days. The elapsed difference is 429 days; counting both endpoints gives 430 dates.
How leap years and month lengths affect date differences
The Gregorian calendar has months of 28, 29, 30 and 31 days. A leap year adds February 29, so any interval that crosses that date gains an additional elapsed day compared with an otherwise equivalent common-year interval.
Years divisible by four are leap years, except century years must also be divisible by 400. The year 2000 was a leap year, while 1900 was not. Counting the actual dates accounts for these differences without relying on an average year length.
Weekdays and weekend days in a date range
Weekdays here are Monday through Friday, and weekend days are Saturday and Sunday. Every complete seven-day period contains five weekdays and two weekend days. Remaining days are classified by their individual weekdays.
A weekday count is not necessarily a working-day count. Public holidays and different work schedules can change which dates are working days. For a calculation that excludes entered holidays, use the Business Days Calculator.
Converting days to hours, minutes and seconds
Multiply the selected day count by 24 to get hours, by 1,440 to get minutes, or by 86,400 to get seconds. A seven-day interval corresponds to 168 hours, 10,080 minutes and 604,800 seconds under this fixed-day conversion.
These are calendar-day equivalents. They do not account for a daylight-saving clock change or a particular start and end time. Measuring an exact duration between local timestamps requires the times and their time zones.
Frequently asked questions about date differences
Is the end date included?
No. This calculation measures elapsed days and excludes the end date. To count every calendar date including both endpoints, add one to the elapsed difference.
Why does the same date give zero days?
The elapsed time between a date and itself is zero. An inclusive count gives one because that range contains one calendar date.
Can the end date be earlier than the start date?
For a forward date range, the end date must be on or after the start date. Enter the earlier date as the start and the later date as the end.
Why can calendar months differ from days divided by 30?
Calendar months have different lengths. Counting complete calendar months follows date boundaries rather than assuming every month has 30 days.
Are public holidays excluded from weekdays?
No. Weekdays exclude Saturdays and Sundays only. A working-day calculation needs separate holiday and work-schedule rules.
How do I calculate age between a birth date and today?
Use the birth date as the start and today as the end. For a dedicated birthday-based breakdown, see the Age Calculator.