Calculate Difference Between Two Dates
Learn how to calculate the difference between two dates in days, weeks, months, years, and business days with examples.
Reviewed against our editorial policy and updated when formulas, thresholds, or guidance materially change. Learn more about AYCalculator.
Searching calculate difference between two dates usually means you need the time span between a start date and an end date. The difference can be expressed in total days, weeks, months, years, or business days โ and which one you need depends on the context.
Use our Date Calculator or Days Calculator for quick results.
The Basic Date Difference
At its core, date difference is subtraction:
Date difference = End date โ Start date
Example:
Start: January 1, 2026 End: June 30, 2026
Difference = 180 days
This is the total calendar day count from Jan 1 through Jun 29 (not including Jun 30 in the exclusive count, or 181 days if inclusive).
Expressing the Difference in Different Units
The same date span can be expressed several ways:
| Unit | Formula | Example (Jan 1 โ Jun 30) |
|---|---|---|
| Days | Subtract dates | 180 days |
| Weeks | Days รท 7 | 25.7 weeks |
| Months | Count calendar months | ~6 months |
| Years | Days รท 365 | ~0.49 years |
Calculating Days Between Dates
Total days is the most straightforward measure. You count every calendar day in the interval.
Example 1:
May 1, 2026 to May 15, 2026:
Counting exclusive of start date: May 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 = 14 days
Counting inclusive of both dates: May 1 through May 15 = 15 days
Example 2:
March 1, 2026 to July 31, 2026:
- March: 31 days (from March 1)
- April: 30 days
- May: 31 days
- June: 30 days
- July 1โ31: 31 days
Using exclusive counting (not counting March 1): 30 + 30 + 31 + 30 + 31 = 152 days
Calculating Weeks Between Dates
Divide total days by 7. This often produces a decimal, meaning the gap is not a perfect number of complete weeks.
Example:
42 days รท 7 = 6 weeks exactly
Example:
50 days รท 7 = 7 weeks and 1 day (7.14 weeks)
For scheduling purposes, you might say โ7 full weeks plus 1 day.โ
Calculating Months Between Dates
Calendar months are trickier because months have different lengths. โThree months from January 31โ is not 90 or 91 days โ it is April 30 (since February 28/29 and March 31 do not have the exact same day count).
The cleanest approach is to count the number of times the calendar month changes:
Example:
January 15, 2026 to April 15, 2026:
- Jan โ Feb (1 month)
- Feb โ Mar (2 months)
- Mar โ Apr (3 months)
Difference = 3 months exactly (same day of month, so no partial month)
Example with partial month:
January 15, 2026 to April 28, 2026:
Full months: 3 (to April 15)
Remaining days: April 15 to April 28 = 13 days
Difference = 3 months and 13 days
Calculating Years Between Dates
For years, divide total days by 365 (or 365.25 for precision over long spans). Alternatively, count how many full years have elapsed by checking if the anniversary has passed.
Example:
May 2, 2020 to May 2, 2026:
Full years = 6 years (same month and day, so no partial year)
Example:
March 10, 2020 to May 2, 2026:
From March 10, 2020 to March 10, 2026 = 6 full years
From March 10 to May 2 = 1 month and 22 days
Difference = 6 years, 1 month, 22 days
Business Days Between Dates
Business day calculations skip Saturdays and Sundays (and sometimes public holidays). They are needed for:
- Shipping and delivery estimates
- Legal response deadlines
- Payroll processing
- Contract notice periods
- Invoice payment terms (โnet 30 business daysโ)
Example: Business days from May 1, 2026 to May 15, 2026
| Date | Day | Included? |
|---|---|---|
| May 1 | Friday | Yes (1) |
| May 2 | Saturday | Skip |
| May 3 | Sunday | Skip |
| May 4 | Monday | Yes (2) |
| May 5 | Tuesday | Yes (3) |
| May 6 | Wednesday | Yes (4) |
| May 7 | Thursday | Yes (5) |
| May 8 | Friday | Yes (6) |
| May 9 | Saturday | Skip |
| May 10 | Sunday | Skip |
| May 11 | Monday | Yes (7) |
| May 12 | Tuesday | Yes (8) |
| May 13 | Wednesday | Yes (9) |
| May 14 | Thursday | Yes (10) |
| May 15 | Friday | Yes (11) |
Business days from May 1 to May 15 (inclusive) = 11 business days
Inclusive vs Exclusive Counting
The same two dates can produce different counts:
| Method | Result | When Used |
|---|---|---|
| Exclusive (mathematical gap) | 14 | Interest accrual, age math |
| Inclusive (both endpoints) | 15 | Event durations, billing periods |
| Inclusive start only | 14 | โHow many days have you had it?โ |
| Inclusive end only | 14 | Counting from โday after purchaseโ |
Always clarify which method applies, especially for contracts, warranties, and legal deadlines.
Common Use Cases for Date Differences
| Scenario | What You Need | Unit |
|---|---|---|
| Project timeline | Start to completion | Days or weeks |
| Employee service period | Hire date to review | Years and months |
| Insurance waiting period | Policy date to coverage start | Days |
| Age calculation | Birthdate to today | Years, months, days |
| Warranty remaining | Purchase date to today vs expiry | Days |
| Interest accrual period | Loan start to payment date | Days |
| Visa duration | Entry date to expiry date | Days |
Common Mistakes When Calculating Date Differences
Off-by-one error โ deciding whether to count the first day, last day, both, or neither.
Assuming months have 30 days โ can cause 1โ3 day errors over multi-month spans.
Ignoring leap year โ February 29 affects year-long calculations.
Confusing business days with calendar days โ can miss or overshoot deadlines.
Mixing date formats โ DD/MM/YYYY vs MM/DD/YYYY can cause month and day transpositions when entering dates manually.
The Bottom Line
To calculate the difference between two dates, choose your start and end date, decide whether you need calendar days, weeks, months, years, or business days, and apply the right counting method. The most error-prone step is deciding whether to include or exclude the endpoint dates.
Use the Date Calculator for date math and the Days Calculator for total day counts โ both handle leap years, month variations, and edge cases automatically.
How to Calculate: Step-by-Step Guide
Select the start date
Choose the first date in the range.
Select the end date
Choose the second date in the range.
Choose output format
Decide whether you need days, weeks, months, years, or business days.