Date & time

Days Between Dates

Count calendar days between two dates without converting local midnights into time-zone-sensitive timestamps. Choose exclusive or inclusive counting and keep or remove direction with the signed option.

● Runs locally
Example values
Runs in your browser · No account required

Days Between Dates

Calendar-day difference
01

Formula

days = UTC calendar day(end) − UTC calendar day(start)

Map each valid calendar date to an integer UTC-style day index, subtract the indexes, then apply inclusive and sign choices.

02

Assumptions

  • The Gregorian calendar is used from year 0001 through 9999.
  • Inclusive mode counts both endpoints for a non-zero span.

Dates represent calendar labels, not instants. Daylight-saving changes cannot alter the result.

03

Formula review

Formula v1.0.0

Reviewed 2026-08-03

CalcFlow engineering review

Worked example

Days Between Dates: Worked example

The day index for 20 August 2026 is 17 greater than for 3 August. Exclusive counting gives 17 days; inclusive counting gives 18.

Frequently asked questions

Frequently asked questions

What is exclusive counting?

It measures how many day boundaries separate the two dates. Inclusive mode additionally counts both endpoint dates.

Can daylight saving change the answer?

No. The engine uses date-only integer arithmetic rather than local timestamps.

What does signed mode do?

It returns a negative count when the end date is before the start date.