How the date difference calculator works
Enter a Start date and an End date. The main result is the total number of calendar days between them. The rows below show the same interval as years, months and days; months and days; weeks and days; decimal weeks; and totals in hours, minutes and seconds. Separate rows count weekdays and weekend days.
The Count the end date switch is off initially. With it off, counting includes the earlier date and stops before the later date. Turn it on to include both boundary dates. For example, November 13 to November 16, 2026 gives 3 days with the switch off and 4 days with it on.
These are date-only inputs. There are no fields for a time of day, time zone, holiday calendar or working schedule. The weekday row always uses Monday through Friday, and weekend days are Saturdays and Sundays.
The date difference formulas
The calculator first puts the dates in chronological order. It uses the earlier date as the lower boundary and the later date as the upper boundary. When end-date counting is on, it moves that upper boundary forward by one calendar day.
Dates are treated as calendar day numbers. Extra day is 0 when Count the end date is off and 1 when it is on.
For the calendar breakdown, the calculator finds the whole months between the lower boundary and the adjusted upper boundary. It then adds those whole months to the earlier date and counts the days still remaining. This is a calendar calculation, not total days divided by a fixed month length.
The floor brackets mean round down to a whole number. Years, months, days uses Whole years, Months left and the remaining days. Months and days keeps the whole-month total instead.
Weeks and days divides total days into complete groups of 7 and a remainder. Total weeks divides by 7 and displays up to two decimal places, without unnecessary trailing zeros. Neither week result depends on which weekday the interval begins.
These are fixed-unit conversions using 24 hours per day, 60 minutes per hour and 60 seconds per minute.
Weekdays are the Monday-through-Friday dates within the same counting boundaries. Weekend days equals total days minus weekdays. Including the later date therefore adds either one weekday or one weekend day, depending on where that date falls.
Worked example with the starting dates
The calculator starts at January 1, 2026 and ends at December 31, 2026, with Count the end date off. The difference is 364 days. Although the dates fall at opposite ends of the year, December 31 is outside the default count.
Adding 11 whole months to January 1 reaches December 1. Another 30 days reaches December 31, so the calendar breakdown is 0 years, 11 months, 30 days. Dividing 364 by 7 gives exactly 52 weeks, with no days left over.
Those 52 complete weeks contain 260 weekdays and 104 weekend days. The time totals are 364 × 24 = 8,736 hours, 364 × 1,440 = 524,160 minutes and 364 × 86,400 = 31,449,600 seconds.
Compare the end-date settings
Both columns below use the starting dates: January 1 through December 31, 2026. Turning on Count the end date moves the internal upper boundary to January 1, 2027 without changing the date you entered. That creates a complete calendar year.
| Result | Switch off | Switch on |
|---|---|---|
| Total days | 364 days | 365 days |
| Years, months, days | 0 years, 11 months, 30 days | 1 year, 0 months, 0 days |
| Months and days | 11 months, 30 days | 12 months, 0 days |
| Weeks and days | 52 weeks, 0 days | 52 weeks, 1 day |
| Total weeks | 52 | 52.14 |
| Total hours | 8,736 | 8,760 |
| Total minutes | 524,160 | 525,600 |
| Total seconds | 31,449,600 | 31,536,000 |
| Weekdays (Mon to Fri) | 260 | 261 |
| Weekend days | 104 | 104 |
Choose the right count for your task
- 1Choose elapsed days or an inclusive count. Leave the switch off for the gap between two dates. Turn it on when you want to count every calendar date touched by an event, including its first and last dates.
- 2Use the result row that fits your question. Use Total days for a single day count, Weeks and days for complete weeks plus a remainder, and Years, months, days for a calendar breakdown. Avoid converting calendar months into a fixed number of days.
- 3Check which boundary date was added. The switch always includes the later chronological date. If that date is a Saturday or Sunday, the extra day goes into Weekend days rather than Weekdays.
Frequently asked questions
What happens if I enter the dates in reverse order?
The calculator orders them internally and returns a nonnegative interval. The note changes to "Counting back from" and keeps your entered date order. If Count the end date is on, it includes the later chronological date, which is then the date in the Start date field.
What is the result when both dates are the same?
With Count the end date off, the result is 0 days. With it on, the result is 1 day, counted as a weekday or weekend day according to that date.
Does the weekday count exclude public holidays?
No. Weekdays means Monday through Friday, even when one of those dates is a public holiday or workplace closure. There is no country, holiday or custom workweek input.
Does the calculator account for leap years?
Calendar-day differences include February 29 when it falls inside the counted interval. For example, February 28 to March 1, 2028 is 2 days with the switch off. Under the Gregorian rule, years divisible by 4 are leap years, except century years must also be divisible by 400.
Why aren't the hours an exact elapsed-time measurement?
Total hours is total days multiplied by 24, without a time of day or time zone. The calculator does not adjust for daylight saving changes or leap seconds. Use a time-zone-aware timestamp calculation when you need the actual duration between two moments.
Why can months and days differ from a days-to-months conversion?
Calendar months have different lengths, so the calculator counts whole months between the dates and then finds the remaining days. It does not divide total days by 30 or by an average month length. The years row groups each 12 whole months into one year.
Sources
- 1Period: between · Oracle · Accessed November 2026
- 2NIST Guide to the SI, Chapter 5: Units Outside the SI · National Institute of Standards and Technology · Accessed November 2026
- 3Leap Years · U.S. Naval Observatory · Accessed November 2026