Why months are harder to count than days

Days have a fixed length, but months do not. A span from March 15 to April 15 and a span from February 15 to March 15 are both one month, yet they contain 31 and 28 days (29 in a leap year). Subscriptions, loan terms, probation periods, lease clauses and warranty windows are all stated in months, so you need an agreed way to count them. This page counts complete months only. It tells you how many whole monthly anniversaries of the start date have been reached by the end date, and it does not report leftover days or fractions. The date inputs use the Gregorian YYYY-MM-DD format and years 0001 through 9999.

The rule used by the page

The page first computes m = 12 × (y2 - y1) + (month2 - month1), the difference between the two month positions. It then moves the start date forward by m months. If the start day does not exist in the target month, the result clamps to the last valid day of that month. When the clamped date is later than the end date, the final month has not been completed, so the answer is m - 1. Otherwise the answer is m. This is called the clamped anniversary rule. It is a product convention chosen so that results are predictable, and it is not drawn from any statute or contract.

The default example, January 31 to February 29

The page opens with a start date of 2024-01-31 and an end date of 2024-02-29. The month positions differ by one, so m = 1. Adding one month to January 31 would give February 31, which does not exist, so the page clamps to February 29, the last day of February 2024. That date is not after the end date, so the answer is 1 complete month. In an ordinary year the same logic works with February 28: from 2023-01-31 to 2023-02-28 also returns 1. This is why the page is useful for month-end dates, where a naive calendar subtraction would claim zero complete months.

When the answer drops by one

The same start date with an earlier end date shows the other branch. From 2024-01-31 to 2024-02-28 the clamped anniversary is February 29, which comes after February 28, so the page returns 0. Another case: 2024-03-15 to 2024-09-14 has m = 6, but the anniversary on September 15 is one day away, so the result is 5. Moving the end date to 2024-09-15 returns 6. Across years the same rule applies, so 2022-06-10 to 2024-06-09 has m = 24 and returns 23. Counting the day before the anniversary as incomplete is the main thing to remember when you compare this page with a rough month estimate.

End-of-month starts

Start dates on the 29th, 30th or 31st deserve extra care. From 2023-11-30 to 2024-02-29 the page returns 3, because November 30 plus three months clamps to February 29, 2024. Change the end date to 2024-02-28 and the answer becomes 2, because the clamped anniversary falls one day later. Each count is made from the original start date, not from a chain of earlier clamped dates, so a start on the 31st does not slide to the 28th for later months. March 31 plus one month is April 30, but March 31 plus two months is May 31 again, which keeps long runs consistent.

Using the count in practice

Typical uses include tenure checks, billing periods and age of an account in months. If a contract says that a warranty lasts twelve months from purchase, you can enter the purchase date and a claim date and see whether the result is at least 12. For a lease that ends on the last day of the month, the clamping rule yields the same dates you would expect from a calendar. Because the page returns a whole number, it works well as a threshold test, such as eligible after six complete months. Always check whether the agreement counts the start day itself, as some contracts include it and others do not. For a probation period that ends after three months, enter the hire date and the review date, and treat a result of 3 or more as the point at which the period is complete under this convention. Keep the end date you used, because moving it by a single day can change the answer.

Months compared with days and years

A complete month is not a fixed number of days, so you cannot convert the result back into days by multiplying by 30. Twelve months from 2024-01-31 reach 2025-01-31, which is 366 days later, while twelve months from 2025-03-01 reach 2026-03-01, which is 365 days later. If you need exact days, use a calculator built for day differences. If you need whole years, use the years between dates page, which applies the same anniversary idea with years. Keeping the three units separate in a report avoids a typical error where a 91-day quarter is described as exactly three months. A span of 90 days and a span of three months can also end on different dates: from 2024-01-01, three months reach April 1, while 90 days reach March 31.

A worked case with a year boundary

Consider an employee who started on 2023-08-31 and has a review on 2024-02-29. The month positions differ by 12 × 1 + (2 - 8) = 6. August 31 plus six months would be February 31, so the date clamps to February 29, 2024, which is not after the review date. The page returns 6 complete months. If the review happened a day earlier, on 2024-02-28, the result would be 5. Writing down both the start date and the end date with the result, along with the statement that month-end anniversaries clamp, lets another person repeat the calculation and understand why the count changed by one.

Limits and assumptions

The page uses the proleptic Gregorian calendar, so local historical calendar changes are ignored. Fractional months are not a fixed duration and are not reported. There is no time of day or time zone, since both inputs are plain calendar dates. The result is not a legal age or tenure rule for any jurisdiction, and some contracts use different month definitions, such as 30-day months or counting from the day after the start. Use this page for the stated clamped-anniversary convention, and follow the wording of the document if it differs. Inputs outside the supported year range are not accepted.