Core answer: to find the days between two dates, add up each month's days. Example: 2026-01-15 to 2026-04-20 = 16 remaining in Jan (31−15) + 28 (Feb) + 31 (Mar) + 20 (Apr) = 95 days. "Days between" excludes the start date; add 1 if you need both ends included.

The basic algorithm

  1. Days left in the start month = month length − start day
  2. Add every full month in between
  3. Add the end month's day number

Convention: difference = end − start (start date excluded). Contracts and interest calculations often count both ends — add 1 there.

Month lengths and leap years

MonthDaysMonthDays
Jan31Jul31
Feb28 (29 leap)Aug31
Mar31Sep30
Apr30Oct31
May31Nov30
Jun30Dec31

Leap-year rule: divisible by 4 but not 100, unless also by 400. 2024 and 2028 are leap years; 2100 is not; 2000 was.

Cross-month example

2026-03-10 to 2026-06-05 (2026 not a leap year):

  • March remaining: 31 − 10 = 21
  • April: 30, May: 31
  • June: 5
  • Total: 21+30+31+5 = 87 days

Cross-year example

2025-11-20 to 2026-03-01:

  • Nov 2025 remaining: 30 − 20 = 10
  • December: 31
  • Jan 31 + Feb 28 (non-leap) + Mar 1
  • Total: 10+31+31+28+1 = 101 days

Estimating workdays

  • Rough: total days × 5/7 (87 days ≈ 62 workdays)
  • Exact: subtract weekends week by week, then public holidays
  • China has ~11-13 statutory holidays per year (after shift adjustments); annual leave is separate
  • For "N working days" in a contract, always confirm whether shifted-working weekends count

Common mistakes

  • "Inclusive or exclusive — who cares": one day is real money in interest and penalty clauses. Banks typically "count the head, not the tail" (deposit day accrues, withdrawal day doesn't).
  • "Treat every month as 30 days": the 30.42-day average works only for annualized estimates. Exact math must use real month lengths — February's 28/29 compounds errors.
  • "A year is 365 days": spanning 2024/2028, a "one-year" period may be 366 days.