Skip to main content

Days Between Dates Calculator

Calculate the exact number of calendar days, weeks, months, years, weekdays, and weekend days between any two dates from year 0001 to 9999 โ€” with zero DST bugs.

Inclusive vs. exclusive date counting (worked examples)

The single most common off-by-one mistake when counting days between dates is forgetting whether the end date should be included. Both conventions are valid depending on what you are measuring:

ScenarioExample rangeToggleResult
Hotel stay (nights)2026-07-10 โ†’ 2026-07-14Exclusive (default)4 nights
Paid leave / vacation2026-07-13 (Mon) โ†’ 2026-07-17 (Fri)Inclusive (+1 day)5 days
Visa entry to exit2026-06-01 โ†’ 2026-06-30Inclusive (+1 day)30 days
DST spring-forward week2026-03-07 โ†’ 2026-03-14Exclusive7 days (exact)

How our integer-day calendar engine avoids DST bugs

Every input date is read strictly as a YYYY-MM-DD string and converted directly to an integer day count using Howard Hinnant’s civil calendar algorithm. Because no JavaScript Date arithmetic or timezone conversion is involved, a 23-hour spring-forward day or 25-hour fall-back day in New York, London, Auckland, or Chatham Islands always yields the exact integer difference.

Leap years handled accurately

  • 2000 and 2024 are leap years (February has 29 days).
  • 1900 and 2100 are century years not divisible by 400, so they are not leap years (February has 28 days).

Frequently Asked Questions

Should I check "Include end date (+1 day)"?

Use exclusive (unchecked) when measuring intervals between checkpoints, such as hotel nights (check-in Monday, check-out Thursday = 3 nights) or elapsed time. Check "Include end date (+1 day)" when both the start and end calendar dates count toward your total โ€” for example, annual leave from Monday to Friday (5 leave days), visa stay days (entry day and exit day both count), or multi-day conferences.

Why do some online calculators get Daylight Saving Time (DST) transitions wrong?

Many JavaScript calculators subtract two local-time Date timestamps and divide by 86,400,000 milliseconds. Across a spring-forward (23-hour) or fall-back (25-hour) DST transition, that produces fractional days like 29.958 or 30.041, which can silently round to the wrong integer. Lasita converts every YYYY-MM-DD date directly to an integer day number with no Date objects or timezone offsets.

How does the Years / Months / Days breakdown handle month-end dates?

Whole calendar months are counted forward from the start date using end-of-month clamping. For example, January 31, 2025 to February 28, 2025 is 1 month, 0 days (28 days); January 31, 2025 to March 1, 2025 is 1 month, 1 day (29 days).

What happens if the end date is earlier than the start date?

The calculator never crashes or silently swaps your inputs. It shows a negative day count along with a one-click "Swap dates" button so you can flip the range immediately.

How are historical dates before October 15, 1582 calculated?

Dates from 0001-01-01 through 9999-12-31 use the proleptic Gregorian calendar (extending modern Gregorian leap-year rules backward). Whenever a range includes a date before 1582-10-15, a clear note is shown beneath the result.

Are the dates I enter sent to a server?

No. The calculator runs inside an isolated frame on dates-frame.lasita.dev with a strict Content-Security-Policy (connect-src none). Your dates are never transmitted over the network, logged, or placed in the page URL.