Skip to content

Date Difference Calculator

Count the days, weeks and months between any two dates.

Updated · Examples checked by automated tests

LOCAL WORKSPACENO UPLOAD REQUIRED

Choose two valid dates to see the difference.

About Date Difference Calculator

Counting days between dates by hand means dealing with month lengths and leap years, and off-by-one errors are almost guaranteed once a month boundary is involved.

This calculator reports the gap in years, months and days together, and separately as a total number of days, weeks, hours and minutes - plus a mode for adding a duration to a date.

How Date Difference Calculator works in your browser

The difference is calculated on calendar dates rather than by dividing milliseconds, so month lengths and leap years are handled correctly and a daylight-saving change never adds or removes a day. It is reported as years, months and days, and separately as total days, weeks, hours and minutes.

By default the end date is excluded; a toggle counts both endpoints. A second mode adds or subtracts days, weeks, months or years from a starting date.

When to use it

  • Counting the days until a deadline, trip or event.
  • Working out the length of a contract, tenancy or employment period.
  • Finding the date a set number of weeks or months from today.

Worked examples

The gap across a short month

Settings: Between two dates, end date not included

Input

2026-01-31 to 2026-03-01

Expected output

0 years, 0 months, 29 days
Total days: 29

Adding a month to 31 January would land on “31 February”, which rolls past 1 March, so a whole month has not yet passed: the gap is 29 days. Counting by months is ambiguous at month ends; the day total is not.

Add one month to 31 January

Settings: Add to a date, 1 month

Input

2026-01-31

Expected output

Result: 2026-02-28

When adding, there is no 31 February, so the result is clamped to the last day of February rather than spilling into March. This matches how most billing systems add a month.

Limits and checks before you use the result

  • Include the end date when counting both the first and last day, such as hotel nights versus days of a trip.
  • Hours and minutes are whole-day multiples; time-of-day and daylight-saving changes are not modelled.
  • Months and years are calendar units, so “1 month” is not a fixed number of days.

Frequently asked questions

Is the end date included?

By default the difference is exclusive of the end date. There is a toggle to count both endpoints inclusively.

Does it account for daylight saving?

Whole-day differences are computed on calendar dates, so a clock change never adds or removes a day.

Can I add or subtract a duration instead?

Yes, the second mode adds or subtracts days, weeks, months or years from a starting date.

Related tools