Date Difference Calculator

Measure elapsed calendar and total time between two dates.

Enter your values

Change any field. The result is recalculated on this device.

Formula, example and assumptions
Calendar difference1 years, 9 months, 8 days

Your result

Local calculation
Calendar difference1 years, 9 months, 8 days

The calendar gap shows the distance between the dates. Total days and whole weeks are negative when the end date is earlier than the start date.

Start date
1 January 2025
End date
9 October 2026
See how this is calculated

Result breakdown

Total days
646
Whole weeks
92
Check the inputs and method

These are your current inputs, not the worked example further down the page.

Start date
1 January 2025
End date
9 October 2026

Method

Total days = (end midnight − start midnight)/86,400,000 milliseconds. Whole weeks = sign(total days) × floor(|total days|/7). Calendar gap advances from the earlier date by complete years, then complete months, then residual days.

Read the worked example and assumptions

How this calculation works

Compare two calendar dates in complete years, months and remaining days, alongside a signed total-day difference. Calendar units help describe an interval; total days help measure its fixed length. The calendar description is the gap’s magnitude, while the sign on total days and weeks indicates whether the end precedes the start.

Total days = (end midnight − start midnight)/86,400,000 milliseconds. Whole weeks = sign(total days) × floor(|total days|/7). Calendar gap advances from the earlier date by complete years, then complete months, then residual days.

Worked example

This example uses illustrative inputs. Your current result is shown above.

From 1 January 2024 to 1 March 2024, the gap is 0 years, 2 months, 0 days. January contributes 31 days and February contributes 29, so total days = 60 and whole weeks = floor(60/7) = 8.

Assumptions and limits

  • The total is elapsed days, not a count including both endpoint dates.
  • Calendar years and months vary in length and use end-of-month clamping.
  • Dates contain no clock times; the elapsed-day calculation is not a measurement of local daylight-saving hours.

Questions people ask

What happens if the end date is earlier?

The calendar gap stays a nonnegative magnitude, but total days and whole weeks are negative. Swap the dates if you want forward totals.

How do I count both the first and last date?

For a forward inclusive count of dates, add one to the elapsed-day total. Business-day counting has its own start/end inclusion settings and holiday exclusions.

Related calculators