The Manual Method
For simple calculations within the same year, count the remaining days in the start month, add full months in between, then add the days in the final month. But this approach becomes error-prone quickly when months of different lengths and leap years are involved.
The Julian Day Number Method
The most reliable approach converts each date to a Julian Day Number (JDN) — a continuous count of days since a fixed reference date — then subtracts. This automatically handles all month-length variations and leap years.
A simplified version for modern dates (after 1 March 1900):
- y = year, m = month, d = day
- If month ≤ 2: adjust y by −1, m by +12
- A = floor(y/100), B = 2 − A + floor(A/4)
- JDN = floor(365.25(y+4716)) + floor(30.6001(m+1)) + d + B − 1524.5
- Days difference = JDN(date2) − JDN(date1)
Worked Examples
| From | To | Days | Common Use |
|---|---|---|---|
| Jan 1 | Dec 31 (same year) | 364 (365 in leap year) | Year length |
| Jan 1, 2024 | Jan 1, 2025 | 366 | 2024 was a leap year |
| Feb 28, 2025 | Mar 1, 2025 | 1 | Non-leap year |
| Feb 28, 2024 | Mar 1, 2024 | 2 | Leap year (Feb 29 exists) |
| Mar 7, 2026 | Mar 7, 2027 | 365 | Exactly 1 year forward |
| Jan 1, 2000 | Jan 1, 2026 | 9,497 | 26 years including 7 leap years |
Business Days vs Calendar Days
Many deadlines are measured in business (working) days rather than calendar days. Business days exclude weekends (Saturday and Sunday) and public holidays. A 30-calendar-day period contains approximately 21–22 business days depending on when it falls in the week.
Practical Use Cases
- Contract deadlines: "30 days from signing" — add 30 days to the signature date
- Pregnancy due date: Add 280 days (40 weeks) to the first day of last menstrual period
- Countdowns: Days until a holiday, event, or retirement date
- Age in days: See our article on calculating exact age in days, weeks, and months
The days calculator below handles all of this automatically — enter any two dates to get the exact number of calendar days, weeks, months, and years between them.