How to Calculate the Date Difference Between Two Dates (Days, Months, Years)

Date differences come up everywhere: ages, employment lengths, project durations, visa stays. The answer can be given two ways, as calendar years-months-days or as a total number of days, and the two are not the same kind of number. Here is how to get both by hand.

The calendar method

Work from the largest unit down. First count whole years: from the start date to the same month and day in later years. Then count whole months: from that anniversary to the same day in later months. What is left is days. Example: from 15 March 2020 to 28 October 2026 is 6 whole years (to 15 March 2026), then 7 whole months (to 15 October 2026), then 13 days. Answer: 6 years, 7 months, 13 days.

The tricky part is month ends. From 31 January to 28 February is not a whole month, because February has no 31st. The usual convention counts it as 28 days, or as 1 month minus 3 days, depending on the tool. If an exact legal answer matters, such as a visa stay, check which convention your authority uses.

The total-days method

For total days, count the days in each full year and month between the dates. For our example: 15 March 2020 to 15 March 2026 is 6 years including one leap day (29 February 2024), so 6 x 365 + 1 = 2,191 days. Then 15 March to 28 October 2026 is 16 + 30 + 31 + 30 + 31 + 31 + 30 + 28 = 227 days. Total: 2,191 + 227 = 2,418 days.

Leap years are the trap. A leap day counts only if it falls strictly between your two dates. From 1 March 2020 to 1 March 2024 there are two leap days in the span (2020 is before the start, 2024 is inside), so careful counting beats guessing. Writing the years out one by one prevents the classic off-by-one error.

Inclusive or exclusive counting

Decide whether to count the start day. From Monday to Friday is 4 days apart if you exclude the start, but 5 days if you count both ends. Travel and bookings usually count both ends (nights, not gaps), while age and employment lengths usually count the gap. State your convention before arguing about a result: most “wrong” date answers are just different conventions.

A quick check: the difference between a date and itself must be zero. If your method gives 1 day for the same date twice, you are counting inclusively. Neither is wrong, but mixing them inside one calculation always is.

Shortcuts for common cases

For ages, subtract the birth year from the current year, then subtract 1 if the birthday has not happened yet this year. For weeks, divide total days by 7: our 2,418 days is 345 weeks and 3 days. For working days, count weekdays only and subtract public holidays for your country, which is the one case where a tool genuinely beats hand counting.

Counting working days

To count working days between two dates, count full weeks first, then the leftover days. Full weeks contribute 5 working days each. For our example of 2,418 days: 2,418 / 7 = 345 full weeks and 3 days left. Full weeks give 345 x 5 = 1,725 weekdays, plus however many of the 3 leftover days fall on weekdays, which depends on the start day of the week.

Then subtract public holidays in your country that fall inside the span. This is the one date calculation where a tool or calendar genuinely beats hand counting, because holiday lists are long and country-specific. For contracts and leave planning, always state whether holidays are excluded.

Try it faster with the tool

You can follow every step above by hand, but the free Online Date Difference Calculator does the arithmetic for you. Enter your numbers and it gives the answer right away, so you can check your hand calculation or skip straight to the result.

Quick tips

  • Years first, then months, then leftover days.
  • Count leap days only if they fall inside your span.
  • Say whether you count the start day or not.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top