Calcorithmevery number has an answer
πŸ”
All tools β†’
← Date & Time

Date Difference

Calculate the number of days, weeks and months between two dates.

Start datei
End datei
Days
906
Weeks
129.4
Months
29.8
Years
2.48

How date differences are calculated

Computers store dates as the number of milliseconds since January 1, 1970 (Unix epoch). To find the difference between two dates, you subtract their millisecond timestamps, then convert to the desired unit. This approach automatically handles different month lengths and leap years β€” no manual calendar checking required.

Days = |Date B (ms) βˆ’ Date A (ms)| Γ· 86,400,000 Weeks = Days Γ· 7 Months β‰ˆ Days Γ· 30.4375 (average month = 365.25 Γ· 12) Years β‰ˆ Days Γ· 365.25 (accounts for leap years)

Common date difference use cases

Contract deadlines
Calculate days remaining until a contract expires or payment is due under net-30 / net-60 terms
Project planning
How many working days between kickoff and launch date? Subtract the result from total days
Age calculation
Days from birth date to today gives exact age for medical or legal purposes
Subscriptions & trials
How long since a trial started? Is the 30-day trial window still open?
Investment holding period
Capital gains tax rates often depend on whether an asset was held more or less than 365 days
Historical research
Days between historical events β€” D-Day to V-E Day was exactly 337 days

Leap years and their effect on date arithmetic

A leap year has 366 days instead of 365. Leap years occur in years divisible by 4, except century years must also be divisible by 400. (2000 was a leap year; 1900 was not.) When calculating differences spanning multiple years, using 365.25 as the average year length accounts for this correctly.

Leap year rule: Divisible by 4? β†’ candidate Divisible by 100? β†’ NOT a leap year (unless…) Divisible by 400? β†’ IS a leap year Leap years: 2000 βœ“, 2004 βœ“, 2024 βœ“, 2100 βœ—, 2400 βœ“ Impact on date differences: Jan 1, 2023 β†’ Jan 1, 2025 = 730 days (no leap year in range) Jan 1, 2023 β†’ Jan 1, 2025 actually = 730 days (2024 has 366: 365+366=731... split varies by start date)

Days vs. months vs. years: when each matters

UnitBest forCaution
DaysPayment terms, deadlines, subscriptions, legal periodsUnambiguous β€” always the safest unit for contracts
WeeksProject sprints, recurring events, employee rotasDivide days by 7; partial weeks are common
MonthsBilling cycles, lease durations, age approximationsMonths vary (28–31 days) β€” use days for legal precision
YearsAge, investment horizon, long-term planningUse 365.25 days/year to account for leap years correctly

Frequently asked questions

How do I calculate the number of days between two dates?

Enter a start and end date and the tool counts the calendar days between them, including a breakdown in weeks and months.

Does it include both the start and end date?

By default it counts the gap between the dates. If you need to include both endpoints (inclusive count), add one to the result.

Can I use it to count down to an event?

Yes. Set today as the start and your event as the end date to see exactly how many days remain.

Does it handle leap years correctly?

Yes. It uses the real calendar, so February 29 is included in any range that spans it.

What this tool does

Calculates the exact number of days between any two dates. Also converts to weeks, months and years. Useful for project timelines, deadlines, anniversaries and contracts.

Input fields explained
Start date
The earlier date in the range. The calculator uses the absolute difference, so order doesn't matter.
End date
The later date in the range. Defaults to today.
iFormula / How it works

Days = |date2 βˆ’ date1| in milliseconds Γ· 86,400,000

Related Date & Time tools

Age Calculator
Exact age in years, months, days
Add Days to Date
What date is N days from now?
Time Duration
Calculate the hours and minutes between two times
Weekday Finder
What day was a specific date?
Stopwatch
Online stopwatch with lap times
Countdown Timer
Set an online countdown timer with an alarm