What the result counts
Choose a starting date and an ending date, then select Calculate. By default, the result counts the days between the dates, leaving out the start date: the same date gives 0 days, and the following date gives 1 day.
Select Include both dates to count every date in the range, including the start and end. The same date then gives 1 day. The result also shows the elapsed day count. Try example fills the dates without calculating; Reset clears them and restores elapsed counting.
Method and example
The calculation uses midnight UTC for each date. It divides the difference by 86,400,000 milliseconds per day to find elapsed days. Including both dates adds one day. The result is an exact whole number of days.
The ECMAScript calendar model applies Gregorian calendar rules to all supported years. Counting dates in UTC avoids local daylight-saving offsets; it does not measure the hours between local midnights. The setUTCFullYear function keeps years 0001 to 0099 as entered.
From February 28, 2024 to March 1, 2024, the elapsed result is 2 days: one step to February 29, then one to March 1. Including both dates gives 3 days. From February 28, 2023 to March 1, 2023, the results are 1 elapsed day or 2 inclusive days.
Assumptions and limits
The tool uses the Gregorian calendar for years 0001–9999 and accepts real dates only. The end must be on or after the start; invalid or reversed dates produce an error. Leap days are included. Weekends and holidays count as ordinary days.
The Gregorian rules also apply to historical dates before their local adoption. This tool does not calculate business days, age or durations between specific times, or apply employment, court, tax or contract deadline rules. Choose the counting convention that fits your task.
Related tools
To find a date a given number of days before or after a start, use Add Days to Date. For a clock-time interval, use Time Duration.