Calcylator
Date Difference

Date difference:
the gap between two dates in any unit

One gap can be written as 2 years 6 months, 936 days or 133 weeks, and each suits a different job.

Calcylator Editorial Team

Updated · 7 min read

What is the date difference?

The date difference is the amount of time between an earlier date and a later one. It is a single gap that can be written in several ways: as years, months and days, as a total number of days, or as weeks.

The right unit depends on what the number is for. Service and tenure are usually quoted as years and months. Warranties, notice periods and refund windows are counted in days. Project plans are easier in weeks.

Between 18 March 2024 and 10 October 2026, for instance, the gap is 2 years, 6 months and 22 days. That is also 936 days and 133 weeks and 5 days. These are one gap in different clothes.

How to calculate the difference between two dates

Gap in years, months and days =(Y₂ − Y₁) years, (M₂ − M₁) months, (D₂ − D₁) days
Later date:
The end date: Y₂, M₂, D₂
Earlier date:
The start date: Y₁, M₁, D₁
Borrow:
Take the length of the month before the later date when the day difference is negative
If days are negative, add the previous month's length and take 1 off the months. If months are negative, add 12 and take 1 off the years.

For the total in days, convert both dates to a running day number, such as the day of the year plus the days in the full years between, and subtract. Spreadsheet software does this internally and shows you the difference as a plain number.

  1. Put the later date first and the earlier date second.
  2. Subtract years, months and days separately.
  3. Borrow if the days or months come out negative.
  4. Convert to days or weeks if you need a single unit.

Example: a rent agreement signed on 18 March 2024

  • Earlier date

    18 March 2024

  • Later date

    10 October 2026

Date difference

2 years, 6 months, 22 days

Total: 936 days, which is 133 weeks and 5 days.

Walking forward confirms it. 18 March 2024 to 18 March 2026 is 2 years. To 18 September 2026 is 6 more months. 18 September to 10 October is 12 days left in September plus 10, which is 22.

The days came out negative at first: 10 − 18 = −8. September's 30 days were borrowed, giving −8 + 30 = 22, and the months fell from 7 (October minus March) to 6.

The total in days comes from running day numbers. 18 March 2024 is day 78 of a leap year, so 366 − 78 = 288 days remain in 2024. Add all 365 days of 2025 and the 283 days of 2026 up to 10 October: 288 + 365 + 283 = 936.

The same gap in different units

18 March 2024 to 10 October 2026
UnitValue for the same gapTypically used for
Years, months, days2 years, 6 months, 22 daysService length, age, tenure
Total completed months30 months (plus 22 days)Loan or lease terms
Total days936 daysWarranties, notice periods, refund windows
Weeks and days133 weeks, 5 daysProject plans and schedules
Hours22,464 hoursRarely needed; days × 24

To turn months into days you cannot multiply by 30 or 31 and expect an exact result. Use the real dates, because the gap from 18 March to 18 September is 184 days, while a flat 6 × 30 would give 180.

Do not mix these. Saying 'about 2.5 years' and 'about 900 days' in the same document invites disagreement, because the shorter forms discard the leftover days differently.

Why some gaps need borrowing

Whenever the later date's day number is smaller than the earlier date's, the days come out negative, so you borrow a month. The table shows three gaps to the same end date, 10 October 2026.

Gap to 10 October 2026
Earlier dateYears, months, daysTotal daysBorrowing needed
5 January 20260 years, 9 months, 5 days278No
15 January 20251 year, 8 months, 25 days633Yes
25 August 20242 years, 1 month, 15 days776Yes

Take the last row. 10 − 25 = −15 days, so borrow September's 30 days to make 15 and reduce the months from 2 to 1. The years do not change, because the months stay positive.

Month lengths matter. Borrow the length of the month immediately before the later date's month: September (30 days) for 10 October, February (28 or 29 days) for 10 March. Borrowing 31 days for the last row above would give 16 days, which is wrong by one.

This is the same rule a birthday calculation uses, and it explains why spreadsheets and online tools agree for most dates and drift by a day only at month ends.

Using the result: tenure, warranty and stays

Tenure is the most familiar use. Someone who joined on 14 June 2023 has 3 years, 3 months and 26 days of service on 10 October 2026, which is 1,214 days. Quote the years-and-months form on a certificate and the day count in a calculation.

A warranty runs on days. A two-year warranty from 18 March 2024 expired on 18 March 2026. That is 206 days before 10 October 2026, so a claim made now would be out of cover by 6 months and 22 days.

A stay or a leave application needs the inclusive count. A hotel booking from 12 to 16 October 2026 is 4 nights by subtraction but 5 calendar days on the premises. Decide which of the two the other party means before you give them a number.

For anything legal or financial, such as interest running between two dates, ask which day-count rule the document uses. Some use actual days, others a 30-day month, and the results differ.

Mistakes when comparing two dates

  • Assuming every month has 30 days. Months run from 28 to 31 days, so 'two months' can be anything from 59 to 62 days.
  • Month-end start dates. From 31 January there is no 31 February, so different tools give different answers for 31 January to 28 February. For contracts, agree the rule in writing.
  • Counting one day too many or too few. Whether the start date, the end date or both are included is a convention you must state.
  • Reading day and month in the wrong order. 03/04/2026 is 3 April in India and 4 March in the US format.
  • Ignoring leap years. 28 February to 1 March is 2 days in 2024 and 1 day in 2026.

The same subtraction gives an age when the earlier date is a birth date, and the age guide on this site covers that angle. For the plain day count and the weeks version, use the days between dates guide and the weeks between dates calculator on this page.

Common questions

How do you calculate the difference between two dates?

Subtract the earlier date from the later one, year, month and day separately, borrowing a month's days when the day difference is negative. From 18 March 2024 to 10 October 2026 the difference is 2 years, 6 months and 22 days.

How many days are between two dates?

Subtract the earlier date's running day number from the later one's. From 18 March 2024 to 10 October 2026 there are 936 days, not counting the start date. Add one if you want both end dates to be counted.

How do you find the difference between dates in months?

Count completed months from the earlier date. From 18 March 2024 to 10 October 2026 there are 30 completed months, with 22 days left over. Dividing days by 30 gives a rough figure, but it is not exact.

Why do different calculators give a different date difference?

They may count the start date or not, treat month ends differently, or round months and years in other ways. A one-day gap often comes from the inclusive or exclusive choice, so compare the rules, not just the numbers.

Does the date difference include the start date?

Usually not: the gap from 1 to 2 October is 1 day. If you want both dates counted, as in a hotel stay or a leave application that includes the first day, add one. Always write down which version you used.

Was this guide helpful?

Continue reading

View all blogs