How to Count Months and Days Between Two Dates
Calculating the exact span of time between two calendar dates involves more than simple subtraction. Because calendar months vary in length between 28, 29, 30, and 31 days, measuring duration in full months and remaining days requires a structured calculation method.
Whether you are tracking project billing milestones, calculating employee tenure, or determining age intervals, this guide explains how to accurately count months and days between any two dates.
The Formula for Counting Months and Days
To calculate the duration between a start date ($D_1, M_1, Y_1$) and an end date ($D_2, M_2, Y_2$), follow these steps:
- Calculate the Day Difference: Subtract $D_1$ from $D_2$. If $D_2 < D_1$, borrow the total number of days in the preceding month from $M_2$, add them to $D_2$, and reduce $M_2$ by 1.
- Calculate the Month Difference: Subtract $M_1$ from $M_2$. If $M_2 < M_1$, borrow 12 months from $Y_2$, add them to $M_2$, and reduce $Y_2$ by 1.
- Calculate the Year Difference: Subtract $Y_1$ from $Y_2$.
Example: Duration from March 25, 2024 to August 10, 2026
Step 1: Days = 10 - 25. Since 10 < 25, borrow July's 31 days.
New Days = 10 + 31 = 41. 41 - 25 = 16 Days.
New End Month = August - 1 = July (Month 7).
Step 2: Months = 7 - 3 = 4 Months.
Step 3: Years = 2026 - 2024 = 2 Years.
Result: 2 Years, 4 Months, and 16 Days.
Month-End Edge Cases Explained
A common challenge occurs when starting from the last day of a month. For example, what is one month after January 31?
Since February has only 28 days (or 29 in leap years), adding one month lands on February 28 or 29, depending on the year. Standard financial and legal accounting conventions treat February 28 as the full one-month mark from January 31.
January 31 + 1 Month = February 28 (or 29)
February 28 + 1 Month = March 28
Practical Applications
- Rental & Lease Contracts: Prorating move-in or move-out dates requires exact day counts combined with full-month rates.
- Project Management: Sprint schedules and milestones depend on distinguishing between calendar days and working business days.
- Financial Amortization: Loan interest accrues daily based on the exact day count between payment dates.
Automate Your Calculations
Instead of performing manual date math, use our free Date Calculator to instantly get exact years, months, weeks, and days between any two dates. Explore our full suite of timing tools in the Date & Time Category.
For business contract deadlines, see our guide on How to Calculate 90 Days From Today.