CalcPocket Logo CalcPocket
Date & Time 4 min read March 2026

How to Calculate the Number of Days Between Two Dates

Deadlines, countdowns, contract lengths, and anniversary planning — how the day-count formula works and where leap years change the result.

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):

  1. y = year, m = month, d = day
  2. If month ≤ 2: adjust y by −1, m by +12
  3. A = floor(y/100), B = 2 − A + floor(A/4)
  4. JDN = floor(365.25(y+4716)) + floor(30.6001(m+1)) + d + B − 1524.5
  5. Days difference = JDN(date2) − JDN(date1)

Worked Examples

FromToDaysCommon Use
Jan 1Dec 31 (same year)364 (365 in leap year)Year length
Jan 1, 2024Jan 1, 20253662024 was a leap year
Feb 28, 2025Mar 1, 20251Non-leap year
Feb 28, 2024Mar 1, 20242Leap year (Feb 29 exists)
Mar 7, 2026Mar 7, 2027365Exactly 1 year forward
Jan 1, 2000Jan 1, 20269,49726 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.

Calculate days between any two dates Use the free Days Calculator on CalcPocket — no signup required.
Days Calculator