DateToolMage

Certified tool

Days Between Dates

Count calendar days between two dates with inclusive or exclusive rules.

Example: 2024-01-01 to 2024-01-31 is 30 days when the end date is not counted, and 31 days when both dates are counted. 2024-02-28 to 2024-03-01 is 2 days because 2024 includes 29 February. Daylight saving time does not change these counts.

Counting rule

Calendar day count

30 calendar days

From Jan 1, 2024 (2024-01-01) to Jan 31, 2024 (2024-01-31).

Exclusive count: 30. Inclusive count: 31.

UK English version

Assumptions

  • Inputs are civil YYYY-MM-DD calendar dates, not timestamps.
  • Exclusive counting is the calendar-day difference (Jan 1 to Jan 2 = 1).
  • Inclusive counting adds one day in the direction of the span (Jan 1 to Jan 2 = 2).
  • Leap days, month lengths, and year boundaries are handled on the Gregorian calendar.
  • DST does not change a date-only day count.
Days Between Dates · DateToolMage