Date Difference Calculator

Find the exact number of years, months, days and total days between any two dates.

Start date

End date

Total days
899days

2y 5m 17d

Years

2

Months

5

Days

17

Total weeks

128

Total months

29

Total days

899

Formula
totalDays = floor((endDate - startDate) / 86,400,000 ms)

About this calculator

The date difference calculator measures the span between two calendar dates. It reports the full breakdown in years, months and days, as well as the totals in days and weeks. The breakdown borrows days from the previous month and months from the year so the result always reflects real calendar lengths rather than a fixed 30-day month.

Use it to count down to an event, measure how long a project ran, work out contract durations, or check how much time has passed since a milestone. The order of the dates does not matter — the calculator always returns a positive difference by measuring from the earlier date to the later one.

Frequently asked questions

It counts the number of whole days between the two dates. If you need both endpoints counted (inclusive), add one day to the total.

Months have 28 to 31 days, so the year/month/day breakdown uses real calendar lengths instead of a fixed 30-day approximation, which makes it more accurate.

Yes. Because the calculation is based on real timestamps, February 29 and leap years are handled automatically.

Did this calculator help you?