THE CALENDAR RULES
A month step is not a day count.
Monthstep changes the year and month first, then applies your chosen rule to the original day number.
Start with a valid date
Enter exactly YYYY-MM-DD, such as 2024-01-31. The supported calendar is proleptic Gregorian: the familiar Gregorian rules extended consistently through years 0001 to 9999. It is a mathematical calendar model, not a reconstruction of historical local calendar adoption.
A source date that does not exist is rejected under both policies. Selecting the last-day rule cannot make February 30 into a valid starting date. Year 0000 is outside this tool’s range.
Make one direct month shift
The source month is represented by an integer index:
index = (year − 1) × 12 + (month − 1) target index = index + signed whole-month offset
The target index gives the new year and month. The tool rejects a result outside years 0001–9999. A positive offset moves later, a negative offset moves earlier, and zero preserves the source date.
Handle a missing day
- Use the target month’s last day if needed: preserve the original day when it exists; otherwise use the last day of that target month. This is the “constrain” policy in the local notes.
- Reject missing day: if the target month lacks the original day number, no usable target result is produced. Old results and copy/download payloads are cleared.
For January 31, 2024 plus one month, the target month is February and its length is 29 days. Constrain uses February 29; Reject reports that day 31 does not exist there. It does not move the overflow into March.
Leap years and month lengths
February has 29 days in a year divisible by 4, except a year divisible by 100 must also be divisible by 400. So 1900 and 2100 are not leap years, while 2000 is. The other month lengths follow the ordinary Gregorian calendar.
Direct shifts and repeated shifts can differ
From January 31, 2024, a direct two-month shift reaches March 31. One constrained month reaches February 29; starting again from that changed date and adding a month reaches March 29. A constrained operation can lose the original day number, so reversing it may not restore the source. Monthstep reports one direct operation rather than constructing a recurrence.
What the civil day difference means
The tool subtracts the source’s Gregorian day ordinal from the target’s ordinal. It does not count selected weekdays, apply holiday rules or multiply days into a duration. A civil date has no timezone or clock here, so the result is not elapsed hours or seconds.
Software and model limits
Dates use years 0001–9999. The offset is a whole integer from −119987 to 119987; the actual target must still fit the date range. Input uses an ordinary minus sign for earlier months, with no plus sign, exponent, fraction or thousands separator. Outer whitespace and leading zeros on the month offset are accepted.
No end-of-month-preserving mode, recurring schedule, reminder, business-day adjustment, timezone, DST, clock, legal deadline or financial calculation is supplied. These rules may differ from those used by a particular contract, application or organisation.
Primary references
The TC39 Temporal PlainDate documentation explains date-only month arithmetic and explicit constrain/reject overflow policies. Python’s calendar documentation provides proleptic Gregorian and month-length context. Monthstep uses its own bounded integer implementation and does not require either library in your browser.