The Simple Question With a Surprisingly Nuanced Answer
Highlighted days on a calendar โ the visual equivalent of a date difference calculation
"How many days between these two dates?" is one of the most commonly asked time-related questions. It comes up when calculating how long until a flight, how many days a rental property was occupied, how long a medication course runs, or how far away a birthday is.
The answer is almost always just a number, but arriving at that number correctly requires understanding the structure of the Gregorian calendar, which the majority of the world uses today.
How Date Difference Is Calculated
At a mathematical level, calculating how many days between two dates means converting each date to an absolute day number and subtracting. The Gregorian calendar's rules for month lengths and leap years are baked into this conversion.
Month lengths in the Gregorian calendar follow a pattern: January (31), February (28 or 29), March (31), April (30), May (31), June (30), July (31), August (31), September (30), October (31), November (30), December (31). These vary, which is why manual counting is tedious and error-prone.
Step-by-Step Manual Calculation
To manually calculate the days between 20 February 2026 and 15 August 2026:
- Remaining days in February: 28 โ 20 = 8 days
- March: 31 days
- April: 30 days
- May: 31 days
- June: 30 days
- July: 31 days
- 1โ15 August: 15 days
Total: 8 + 31 + 30 + 31 + 30 + 31 + 15 = 176 days.
Days Between = Sum of days in each partial or complete month in the interval
How Leap Years Change the Answer
If the date range crosses 29 February, the answer increases by one day compared to the same range in a non-leap year. The years 2024, 2028, and 2032 are leap years. If your date range spans February of one of these years, your calculation yields one more day than in an equivalent non-leap-year span.
Year Boundary Calculations
When dates fall in different years, a common approach is to calculate the remaining days in the start year, add the full years in between (365 or 366 days each), and then add the elapsed days in the final year. An online date difference tool performs this automatically.