How to Calculate Date Difference

Find the number of days, weeks, months, or years between two calendar dates with worked examples, inclusive counting tips, and calendar logic.

By CalcWell Team · ·

To find the difference between two dates, count the days from the earlier date to the later one. Counting from January 15 to March 10 gives 54 days (16 left in January, 28 in February, 10 in March). If you also count both the start and end day, you get 55. That choice, inclusive or exclusive, is the first decision to make. This guide shows the method, how leap years change the answer, and how to turn a day count into weeks, months, and business days. For instant results, use the date difference calculator.

Inclusive versus exclusive counting

The simplest rule: the difference between two dates is the number of midnights you cross. From Monday to Friday of the same week you cross four midnights, so the difference is 4 days. That is the exclusive count, and it is what subtraction gives you.

An inclusive count adds one, because it treats both the first and last day as full days: Monday, Tuesday, Wednesday, Thursday, and Friday is 5 days. Use inclusive counting for things like a 5 day training course or how many days a project runs. Use exclusive counting for ages, nights of a stay, countdowns, and loan terms. When in doubt, write down which one you used.

Month lengths and leap years

MonthDaysMonthDays
January31July31
February28 (29 in a leap year)August31
March31September30
April30October31
May31November30
June30December31

A year is a leap year if it meets these rules, checked in order:

  1. If it is divisible by 400, it is a leap year (2000 was).
  2. Otherwise, if it is divisible by 100, it is not (1900 and 2100 are not).
  3. Otherwise, if it is divisible by 4, it is a leap year (2024 and 2028 are).
  4. Otherwise, it is not.

A normal year has 365 days (52 weeks and 1 day) and a leap year has 366 (52 weeks and 2 days). The extra day is February 29, so it only matters if your date range includes it.

The step by step method

  1. Put the dates in order: earlier first, later second.
  2. Count the days left in the first date's month (month length minus the day number).
  3. Add the full months in between, using the real length of each.
  4. Add the day number of the later date.
  5. Add 1 if you want an inclusive count.

For ranges over a year, count whole years first (365 or 366 days each, depending on whether they contain February 29), then handle the remainder.

Worked examples

Example 1: January 15 to March 10, 2026

  1. Rest of January: 31 − 15 = 16 days.
  2. All of February 2026 (not a leap year): 28 days.
  3. Days into March: 10.
  4. Total: 16 + 28 + 10 = 54 days, or 55 inclusive.

As weeks and days: 54 ÷ 7 = 7 remainder 5, so 7 weeks and 5 days. As a calendar breakdown it is 1 month and 23 days: January 15 to February 15 is one month, then February 15 to March 10 is 13 days left in February plus 10 days in March, which is 23.

Example 2: Spanning February 29, 2028

February 20, 2028 to March 5, 2028.

  1. 2028 is divisible by 4 and is not a century year, so it is a leap year and February has 29 days.
  2. Rest of February: 29 − 20 = 9 days.
  3. Days into March: 5.
  4. Total: 9 + 5 = 14 days.

The same dates in 2027 give 8 + 5 = 13 days. Both February 20 and March 5, 2028 fall on a Sunday, which agrees with 14 days being exactly 2 weeks.

Example 3: Years, months, and days

November 20, 2024 to March 10, 2026.

  1. November 20, 2024 to November 20, 2025: 1 year.
  2. November 20, 2025 to February 20, 2026: 3 months.
  3. February 20 to March 10, 2026: 8 days left in February plus 10 days = 18 days.
  4. Result: 1 year, 3 months, 18 days.

As a day count: 365 (the year) + 92 (November 20 to February 20: 10 + 31 + 31 + 20) + 18 = 475 days, which is 67 weeks and 6 days. Months are not a fixed unit: the 3 months here span 92 days, while January 1 to March 1, 2026 spans only 59.

Example 4: A full year that contains a leap day

December 25, 2027 to December 25, 2028 is 366 days because the range includes February 29, 2028. That is 52 weeks and 2 days. The same span one year later, from December 25, 2028 to December 25, 2029, is 365 days.

Business days

A business day count excludes Saturdays and Sundays, and optionally public holidays. A fast way: divide the total days by 7, multiply the full weeks by 5, then check the leftover days one by one.

For Example 1 (January 15 up to but not including March 10, 2026, starting on a Thursday):

  1. 54 days = 7 full weeks and 5 extra days. The full weeks hold 7 × 5 = 35 weekdays.
  2. The 5 extra days run Thursday, Friday, Saturday, Sunday, Monday, which contain 3 weekdays.
  3. Total: 35 + 3 = 38 business days.
  4. If you also skip two US federal holidays that fall in the range, Martin Luther King Jr. Day (January 19) and Presidents Day (February 16), you get 36.

Holidays differ by country, state, and employer, so a generic count cannot know them. Add them yourself after counting weekdays. To move a date forward or back by a number of days, use add or subtract days.

Reference: days in common spans

SpanDaysWeeks and days
1 week71 week
30 days304 weeks 2 days
90 days9012 weeks 6 days
180 days18025 weeks 5 days
1 common year36552 weeks 1 day
1 leap year36652 weeks 2 days

Common mistakes

  • Mixing inclusive and exclusive counts. Decide first, and say which one you used.
  • Assuming every month has 30 days. That error compounds across a year. Use the real month lengths.
  • Missing a leap day. Only ranges that contain February 29 are affected. Century years such as 2100 are not leap years.
  • Treating “one month later” as 30 days. January 31 plus one month has no February 31, so tools usually land on the last day of February.
  • Forgetting time zones. If dates come with times in different zones, convert them first. See the guide on calculating age in days for a related case, or the age calculator.

Frequently asked questions

How many days are there between two dates?

Subtract the earlier date from the later one, counting real month lengths. Add 1 only if you want both end dates counted.

How do I find the number of weeks between two dates?

Divide the day count by 7. The whole number is the weeks and the remainder is the extra days. For 54 days that is 7 weeks and 5 days.

Is 2100 a leap year?

No. It is divisible by 100 but not by 400, so February 2100 has 28 days. The year 2000 was a leap year because it is divisible by 400.

Why do tools give different month counts for the same dates?

Because months have different lengths, there is more than one convention for end-of-month dates. The day count is always unambiguous, so compare that first.

Let the calculator do it

Enter any two dates in the date difference calculator for days, weeks, and a years, months, and days breakdown. To count down to a single future date, try the days until calculator, or browse the date and time calculators.

References

We use cookies and similar technologies to improve your experience, analyze traffic, and show personalized ads. By clicking "Accept", you consent to the use of cookies. Privacy Policy · Cookie Policy