Days Between Two Dates
Number of days separating two calendar dates.
Formula
Live Calculator
MembersVariables
Example
From 2000-01-01 to 2000-12-31 ⇒ 365 days
How it works
This formula finds the gap between two calendar dates by converting each date into a Julian Day Number (JDN), which counts days on a continuous scale. Once both dates are on the same day-count timeline, subtracting the earlier JDN from the later one gives the exact number of whole days between them, with leap days automatically included if they occurred in the interval. The result is a signed difference: positive if the second date is later, negative if it is earlier.
When to use it
Use this when you need an exact day count between dates in scheduling, billing, project timelines, loan periods, or age calculations. It is especially useful in science and programming because it avoids errors from differing month lengths and leap years.
Worked example, step by step
Find the number of days from 2024-02-10 to 2024-03-05. JDN_1 = 2460350 for 2024-02-10 JDN_2 = 2460374 for 2024-03-05 Δ = JDN_2 - JDN_1 Δ = 2460374 - 2460350 Δ = 24 So, there are 24 days between the two dates.
Common mistakes to avoid
- Subtracting calendar dates directly without converting to a continuous day count
- Forgetting that leap days can change the result in spans that include February 29
- Mixing up the order of subtraction and getting the sign reversed
Did You Know?
Converting both dates to a single running day count sidesteps every leap-year and month-length headache.
Share this formula
More in Time & Calendar
View allLeap Year Rule
BasicTests whether a Gregorian year has 366 days.
Clock Hand Angle
BasicAngle between the hour and minute hands of an analog clock.
Zeller's Congruence
AdvancedFinds the day of the week for any Gregorian date.
Day of the Week from a Birthdate
IntermediateGauss's weekday formula — find which day of the week any birthdate fell on.
Julian Day Number
AdvancedContinuous day count used by astronomers to compare dates.
Age in Years
BasicWhole years elapsed since a birth date.