Calendar

What happens when you add a month to January 31?

Decide what adding one month means when the target month has no 31st.

Try the experiment

What you’ll learn Compare clamping, rolling forward and rejecting an unavailable day, and see why repeated clamping can drift.

Month-end policy

Where does January 31 land?

Compare a common year with a leap year, then change the rule for the missing day.

Experiment controls

February 28, 2025

  • StartJanuary 31, 2025
  • February endsFebruary 28, 2025
  • Chosen resultFebruary 28, 2025

February has 28 days in this year. The requested 31st is 3 days beyond its last day.

Apply the result

Your instruction is “at the end of every month.” The February date was the 28th. What do you send for March?

Schedule an end-of-month report

Inputs
The first report was January 31, 2025, then the February copy was sent on February 28.
Reasoning
If the instruction is “last day of each month,” derive each month’s end independently. Adding a month to the last sent date is a different operation.
What the result means
March 31 is correct for the report. Repeatedly adding to February 28 would instead give March 28.

Move to February before handling the missing day

A common February ends on the 28th. Clamping chooses that end. An overflow rule preserves the three excess numbers, walking March 1, 2 and 3. Rejecting returns no date. February 29 exists in 2024 but not in 2100, even though both years divide by four.

Ask what must be preserved

If a report is due on the final day, the anchor is month-end and March must end at March 31. Starting a new calculation from the clamped February 28 preserves the number 28 instead. Recalculate recurrence from the original intent, not just the preceding output.

Test the service, not the phrase

Calendar APIs use concrete overflow settings; calendars and contracts may select a different policy. Record what a system actually does for January 31 and for the following cycle. When there is no agreed rule, a rejection is useful because it prevents somebody from silently moving a deadline.

Sources and scope

These are stated teaching policies, not a legal deadline recommendation. Add & Subtract Dates uses clamping for a missing day.

Share preview

Share your result

Text version