How to Count Days Between Two Dates (and Why It Is Trickier Than You Think)

Subtracting two dates sounds like primary-school math. Then leap years, time zones and weekends show up.

Most people learn the formula once in school and never touch it again — until life forces them to. Subtracting two dates sounds like primary-school math. Then leap years, time zones and weekends show up.

The formula behind date difference calculator

Days = |end − start| / 86,400,000 (in milliseconds)

Examples

  • 1 Jan 2024 → 1 Jan 2025 = 366 days (2024 is a leap year).
  • Same range, working days only (Mon–Fri) = 262.
  • Across DST boundaries the same UTC date can differ by an hour locally — the day count is unaffected.

Inclusive vs exclusive day count

From the 1st to the 5th — is that 4 or 5 days? Exclusive (4) is what most calculators report; inclusive (5) is what hotels charge you.

Working days vs calendar days

Working days excludes weekends and (optionally) public holidays. Useful for project deadlines, contract terms, leave calculations.

Why months are 'approximate'

Months range from 28 to 31 days. Most calculators average 30.44 days/month — fine for casual use, wrong for legal periods.

Frequently asked questions

How do I subtract dates including time? Calculate the difference in milliseconds, divide by 86,400,000 for days. Round to taste.

Are public holidays deducted? Not by default — you'd need a country-specific holiday list. Most generic calculators only exclude weekends.

Whatever number you land on, sanity-check it against a second method or a quick estimate in your head. Try the How to Count Days Between Two Dates (and Why It Is Trickier Than You Think) linked above to put these numbers to work right now.

Related