Explanation
What this measures
Days between measures the distance from one date to another. Counting both ends instead counts every named date from the start through the end, so it is always one more.
How to use it
Enter both dates as YYYY-MM-DD. Choose days between for a duration such as a notice period; swapping the dates makes it negative. Choose both ends counted when every listed date matters, such as days on a trip or an attendance list. That mode needs the end to be on or after the start.
D = E − S
| D | number of days |
|---|---|
| S | day number of the start date, counted from 0001-01-01 |
| E | day number of the end date, counted from 0001-01-01 |
D = E − S + 1
| D | number of days |
|---|---|
| S | day number of the start date, counted from 0001-01-01 |
| E | day number of the end date, counted from 0001-01-01 |
Cross a leap day
| Start date | Feb 28, 2024 |
|---|---|
| End date | Mar 1, 2024 |
| Result | 2 days |
Day number of 2024-03-01 − day number of 2024-02-28 = 2 days
Reverse the direction
| Start date | Mar 1, 2024 |
|---|---|
| End date | Feb 28, 2024 |
| Result | -2 days |
Day number of 2024-02-28 − day number of 2024-03-01 = -2 days
Count all 3 named dates
| Start date | Feb 28, 2024 |
|---|---|
| End date | Mar 1, 2024 |
| Result | 3 days |
Day number of 2024-03-01 − day number of 2024-02-28 + 1 = 3 days, counting both dates
Diagram of this result
The diagram draws a timeline between the two dates, marks the month or year boundaries it crosses, and states the number of days.
A text summary gives the same two dates and the number of days.
Common mistakes
A same-day span has zero days between but one date when both ends are counted. Calendar days are not exact 24-hour periods across daylight saving changes. Use the unambiguous year-month-day form.
Limits and assumptions
Gregorian calendar, years 0001–9999. Dates have no time of day, timezone, holiday or workday meaning. Counting both ends rejects reversed dates.
Sources
Gregorian calendar leap-year rule. Check: February 28 to March 1 is two days in 2024 and one day in 2023.
Does this account for leap years?
Yes. Years divisible by four are leap years, except century years unless they are divisible by 400.