Dates & time

Days Between Dates Calculator

Count dates using calendar days rather than local-clock elapsed hours. The start date is included in work-day enumeration and the end is excluded unless the inclusive option is checked.

  • Explicit formulas and worked examples
  • Check your inputs, then calculate
  • Data is calculated in this browser only

Check the stated input format, calculation convention and limits before using the result.

Your inputs

Local calculation

Check the example inputs, then calculate. Your values stay in this browser.

End must be on or after start; an equal pair yields zero unless the end is included.

Calculation notes

Understand the Days Between Dates Calculator

Days Between Dates Calculator validates start date, end date, include the end date before applying the displayed equation. End must be on or after start; an equal pair yields zero unless the end is included.

Formula and logic

What is the formula for the Days Between Dates Calculator?

Days Between Dates Calculator: days = (UTC(end) − UTC(start)) / 86400000 + inclusiveEnd. Input definitions: start = Start date; end = End date; inclusive = Include the end date. Use the selected convention throughout the calculation.

Worked example

How can I reproduce the Days Between Dates Calculator example?

Days Between Dates Calculator baseline input: Start date: 2026-01-01; End date: 2026-01-31; Include the end date: not selected. Output: Calendar days = 30 days. Substitute these values into the displayed equation to reproduce the result.

How to read the result

How should I interpret the Days Between Dates Calculator result?

  • Read calendar days with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
  • Change one input at a time and use the equation to explain the result; do not mix unit, grade-scale, time-zone or rounding conventions across comparisons.
Limits and assumptions

What limits apply to the Days Between Dates Calculator?

  • End must be on or after start; an equal pair yields zero unless the end is included.
  • Work days exclude Saturdays, Sundays and supplied holidays only; local public holidays are not fetched automatically.
  • Calendar-date inputs and calculated calendar dates must stay within years 0001–9999.

Content and calculation reviewed:

Understand the calculation

How to use it and the math behind it

Read the complete explanation

Four steps to check your inputs and results

  1. Count dates using calendar days rather than local-clock elapsed hours. The start date is included in work-day enumeration and the end is excluded unless the inclusive option is checked.
  2. Enter Start date, End date, Include the end date in the stated format. Baseline values are for reproduction.
  3. Check the output unit and convention: Read calendar days with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
  4. Change one input and compare the result. End must be on or after start; an equal pair yields zero unless the end is included. Work days exclude Saturdays, Sundays and supplied holidays only; local public holidays are not fetched automatically. Calendar-date inputs and calculated calendar dates must stay within years 0001–9999.

Days Between Dates Calculator: calendar conventions

Calendar-day subtraction excludes the end date by default. From February 28 to March 1 in leap year 2024 there are two day transitions: February 29 and March 1. Including the end adds one, producing three counted calendar dates. This is date arithmetic at UTC midnight, not a measure of local elapsed hours across daylight-saving changes.

days = (UTC(end) − UTC(start)) / 86400000 + inclusiveEnd

The detailed guide adds variable definitions, a reproducible example, a practice question and model limitations.

From question to result

Continue with a related question

Explore all Dates & time tools and guides