Adding months to a date: why Jan 31 + 1 month is tricky
Days and weeks are always the same length. Months aren't, and that makes "one month from now" less obvious than it sounds.
The problem
Add one month to January 15 and you get February 15 with no argument. But what is one month after January 31? There is no February 31. Something has to give, and different tools make different choices, which is why this question causes real bugs in billing, scheduling and reminder software.
The common rule: use the last day of the month
The most widely used approach is to keep the day of the month when it exists and otherwise use the last day of the target month. This is often called month-end clamping. With it:
- January 31, 2027 plus 1 month is February 28, 2027.
- January 31, 2028 plus 1 month is February 29, 2028, because 2028 is a leap year.
- August 31, 2027 plus 1 month is September 30, 2027, since September has 30 days.
- January 31, 2027 plus 2 months is March 31, 2027, because March has a 31st.
The Date Calculator uses this rule, and tells you whenever it had to move to the last day of the month.
Going backwards works the same way
Subtracting months follows the same logic. March 31, 2027 minus 1 month would be February 31, which doesn't exist, so the result is February 28, 2027. Notice that this is not reversible: adding one month to February 28 gives March 28, not March 31.
Why you shouldn't add months one at a time
Suppose you add one month to January 31, 2027, then add another month. The first step gives February 28, and the second gives March 28. But adding two months in a single step gives March 31. Clamping loses information at each step, so the order matters. When you need several months, always add them in one go from the original date.
Leap years and adding years
February 29 exists only in leap years: years divisible by 4, except century years that are not divisible by 400. So 2028 and 2032 are leap years, while 2100 is not. Adding a year to February 29, 2028 lands on 2029, which has no February 29, so the clamped result is February 28, 2029. Adding four years instead gives February 29, 2032, since 2032 is a leap year.
People born on February 29 run into exactly this: whether the birthday is observed on February 28 or March 1 in common years depends on local law and custom.
Months are not 30 days
It is tempting to treat a month as 30 days. The results drift apart quickly. January 31, 2027 plus 30 days is March 2, 2027, but plus one month is February 28. And 28 days after January 31 is February 28, which only coincides with the month rule in a common year. If a rule says "one month", use months. If it says "30 days", use days.
What contracts and subscriptions do
Some agreements spell out their own handling: "the same day next month, or the last day if there is none", or "30 days after the invoice date". When the wording is explicit, follow it, and use the calculator only to check the arithmetic. If a document is silent, the clamping rule is the usual convention, but it is not universal, so check before relying on it for anything important.
Quick summary
- Keep the day of the month when the target month has it, otherwise use the target month's last day.
- January 31 plus 1 month is February 28, 2027, or February 29, 2028.
- Add several months in a single step: one step of 2 months from January 31 gives March 31, but two steps of 1 month give March 28.
- February 29, 2028 plus 1 year is February 28, 2029; plus 4 years is February 29, 2032.
- A month is not 30 days. Use the unit the rule actually names.
Open the Date Calculator to try these examples with your own dates. Everything runs in your browser and nothing is sent anywhere.