Skip to calculator
Libre CalculatorThe universe in numbers

Date difference calculator

Count the days between two dates, with or without both ends included.

Calculation

Answer

283 days

Steps

Day number of 2026-10-11 − day number of 2026-01-01 = 283 days

The span between the two dates
A timeline from Jan 1, 2026 to Oct 11, 2026 with month or year boundaries marked: 283 days apart.

Watch the explainer

194 seconds · 8 chapters · captions included

0:00 / 3:14Two nights or three days?

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

Variables
Dnumber of days
Sday number of the start date, counted from 0001-01-01
Eday number of the end date, counted from 0001-01-01

D = E − S + 1

Variables
Dnumber of days
Sday number of the start date, counted from 0001-01-01
Eday number of the end date, counted from 0001-01-01

Cross a leap day

Start dateFeb 28, 2024
End dateMar 1, 2024
Result2 days

Day number of 2024-03-01 − day number of 2024-02-28 = 2 days

Reverse the direction

Start dateMar 1, 2024
End dateFeb 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 dateFeb 28, 2024
End dateMar 1, 2024
Result3 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.