Months Between Dates
How many months between two dates?
Whole calendar months and the days left over — worked out by walking the calendar, so the answer matches what a lease, a loan schedule or a notice period means by "a month".
How this is worked out
- Whole months are found by anchoring: the largest number of months that still lands on or before the end date, then the days from there.
- Field-by-field subtraction with borrowing is not used — it gets 31 January to 1 March wrong.
Questions people ask
The things that come up about months between datess, answered plainly.
How many months is 31 January to 28 February?
Zero months and 28 days — February has no 31st, so a whole month has not passed. On 1 March it becomes one month and one day. Anchoring to the start date this way is what stops the end-of-month cases sliding around.
Why is the decimal month total different?
The decimal uses the mean Gregorian month of 30.436875 days, which is the only sensible fixed length. It is flagged approximate for that reason; the whole-month count above it is exact.
Related tools
How far apart two instants are — in whichever unit you need, counting every day or only the working ones.