Time & Date
Days between dates calculator
Pick two dates — see the exact number of days between them, plus weeks, months, years, hours, minutes, and seconds.
Formula
Computing exact day counts between two dates is harder than it looks: months have different lengths, leap years add a day every four years (with the century rule), and timezone changes can shift midnight. This calculator sidesteps the complexity by working in UTC milliseconds — subtract the two timestamps, divide by 86,400,000, and round.
The higher-unit conversions (weeks, months, years) use average lengths: 7 days per week (exact), 30.4375 days per month (365.25 / 12), 365.25 days per year (Gregorian calendar average accounting for leap years). They're approximations — actual calendar months and years vary. For exact calendar arithmetic (X years and Y months and Z days), use the age calculator instead.
Negative results mean the 'to' date is before the 'from' date. The total counts as a signed integer.
Examples
- 01From 2024-01-01 to 2025-01-01→ 366 days (2024 is a leap year)
- 02From today to next New Year→ Varies — try it
- 03From 1969-07-20 (moon landing) to 2024-07-20→ 20,089 days = 55 years
FAQ
- Months don't have a fixed length (Feb is 28-29, others 30-31), so the calculator divides total days by 30.4375 (the average across a 4-year cycle). It's accurate as a duration measure but not a calendar count. For calendar-correct '5 months and 3 days', use the age calculator with the two dates as DoB and 'as of'.