How to Calculate Days Between Two Dates
Calculating the exact number of days between two dates requires accounting for varying month lengths, leap years, and the calendar system. The simplest approach is to convert both dates to a serial day number (like Julian Day Number or a spreadsheet date serial), subtract, and you have the difference in days. This guide explains the concept and shows a manual worked example.
Last updated: March 31, 2026
The Formula
Days between dates = Date2 serial − Date1 serial Weeks = Days ÷ 7 Months ≈ Days ÷ 30.44 Leap year: divisible by 4, except centuries unless also divisible by 400
Variable Definitions
| Symbol | Name | Description |
|---|---|---|
| D1, D2 | Start & End Dates | The two calendar dates to compare — D2 should be the later date for a positive result |
| Serial | Day Serial Number | A sequential integer assigned to each calendar date for arithmetic purposes |
Step-by-Step Example
How many days are between March 15, 2024 and November 28, 2024?
Given
Solution
- 1Count days remaining in March after the 15th:
31 − 15 = 16 days - 2Add days in April through October (7 full months):
30+31+30+31+31+30+31 = 214 days - 3Add days in November up to the 28th:
28 days - 4Sum all:
16 + 214 + 28 = 258 days
There are 258 days between March 15 and November 28, 2024.
Ready to calculate?
Use the free Date Difference Calculator — instant results, no sign-up.
Common Mistakes to Avoid
Forgetting leap years — February 29 exists in 2024 (divisible by 4) but not in 2100 (century not divisible by 400).
Off-by-one errors — whether to include the start date, end date, or both depends on context (e.g. deadline counting vs duration).
Confusing calendar months with 30-day months — month lengths are 28–31 days, not uniformly 30.
Ignoring time zones for precise timestamps — if events are in different time zones, convert to UTC first.