Date Difference Calculator

Count calendar days between two dates, with an option to include both dates.

Count days between dates

Start day excluded. Calendar totals count all days; end must be on or after start. Years 0001–9999.

Your result

Enter your values and select Calculate, or use Try example.

Method & examplesReviewed · Sources

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. The custom business calendar is not an official holiday calendar and does not apply employment, court, tax or contract deadline rules. The tool does not calculate age or durations between specific times. Choose the counting convention that fits your task.

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.

Weeks and calendar years, months and days

Full weeks are the selected day count divided by seven, with the remaining whole days shown separately. Calendar breakdown uses the largest total number of months that can be shifted from the start without going beyond the effective endpoint. Years and months combine into one shift; the original day is clamped once to the last valid day of the target month. Remaining days are then added. Months are not fixed-length durations.

January 31 to February 29, 2024 is 29 days, or 4 weeks and 1 day, or 0 years, 1 month and 0 days. January 31 to March 30 is 1 month and 30 days. With both dates included, the effective endpoint is one day after the end; March 30 then becomes 2 months and 0 days. After December 31, 9999, that extra endpoint exists only as an internal day number; calendar anchors stay within supported dates.

Custom business days

Choose Business days to select nonworking weekdays and enter up to 1,000 unique manual exception dates, one ISO YYYY-MM-DD date per line. Saturday and Sunday are the default nonworking weekdays. Every invalid nonblank line must be corrected. Duplicates do not use the unique-date limit. Exceptions outside the period stay visible with an outside-period marker and do not affect the count.

Business counting includes the start and excludes the end by default: [start, end). Include both dates changes this to [start, end]. A nonworking weekday that is also a manual exception is excluded only once; the list shows both reasons. Choose all seven weekdays for zero working days or none to count every day except manual exceptions.

October 19 to October 26, 2026 gives 5 working days by default, or 6 with both dates included. Excluding October 20 gives 4 or 5. Duplicate October 20 and Saturday October 24 entries do not subtract any additional days.

The full years 0001–9999 remain available. Counts use full weeks, remaining days and unique exceptions. Excluded dates appear in pages of at most 100, with the full excluded total shown separately. Copy full summary copies totals, boundaries and manual exceptions; Copy current excluded page copies only the displayed page and identifies it as a partial list. This is your custom calendar, not official holidays or a legal deadline.

Sources and model

Method version 1.2.0. Reviewed .

Maintained by Aleksandr Pervukhin. Report a calculation error.