How the new date is found
Days and weeks are fixed lengths, but months and years are not: a month can be 28, 29, 30 or 31 days, and a year 365 or 366. The calculator therefore handles the two kinds of unit separately and always in the same order.
- Years and months first. A year counts as 12 months. The calculator moves the month forward (or back) by that many months and keeps the same day of the month: March 10 plus 2 months is May 10.
- Month-end clamping. If that day does not exist in the new month, the result moves to the month’s last day. January 31 plus one month is February 28, or February 29 in a leap year.
- Weeks and days second. Weeks become 7 days each, and the total number of days is counted forward or back on the calendar, across month and year boundaries.
Subtract runs the same steps backward: months come off first, with the same clamping, and then the days.
The formula
Steps 1 and 3 are exact. Step 2 is a convention: other software may roll an impossible date into the next month instead (January 31 + 1 month = March 3), so two programs can disagree on month-end dates.
Worked examples
- Move from January to February and keep day 31.
- February 2026 has 28 days, so the day is clamped to 28.
- 2028 is a leap year, so February has 29 days and the result is February 29.
- Adding 90 days counts 18 days to the end of October, 30 in November, 31 in December and 11 in January: 18 + 30 + 31 + 11 = 90.
- Adding 3 months moves October 13 to January 13.
- October 13 to January 13 is 92 days, two more than 90, because October and December each have 31 days.
- One month after January 30 would be February 30, which does not exist, so it is clamped to February 28.
- Two days later is March 2.
- Doing the days first would give February 1 plus 1 month, which is March 1, one day earlier. The fixed order keeps results repeatable.
- Choose Subtract and enter 6 weeks: 6 × 7 = 42 days.
- Count back 13 days to September 30, then 29 more days to September 1.
- Whole weeks never change the weekday, so the answer is also a Tuesday.
Month-end dates at a glance
| Start date | Change | Result |
|---|---|---|
| May 31, 2026 | + 1 month | Tuesday, June 30, 2026 |
| October 31, 2026 | + 1 month | Monday, November 30, 2026 |
| August 31, 2026 | + 6 months | Sunday, February 28, 2027 |
| March 31, 2026 | − 1 month | Saturday, February 28, 2026 |
| February 29, 2024 | + 1 year | Friday, February 28, 2025 |
| January 31, 2028 | + 1 month | Tuesday, February 29, 2028 |
Where date arithmetic trips people up
- Treating a month as 30 days. A three-month notice period from October 13 ends on January 13, but 90 days ends on January 11. Read the contract to see which one it uses.
- Adding one month twice. January 31 plus 2 months is March 31, but January 31 plus 1 month (February 28) plus 1 month is March 28. The clamped day does not remember that it started on the 31st.
- Expecting subtraction to undo addition. March 31 minus 1 month is February 28, and February 28 plus 1 month is March 28, not March 31.
- Counting the start date as day one. The calculator treats the start date as day zero, so “10 days from Monday” lands on a Thursday 10 days later. If a rule says the first day counts, subtract one day from what you enter.
- Forgetting weekends and holidays. A deadline of “30 days” is calendar days unless it says otherwise. For working days, use the business days calculator.
Results stay on the Gregorian calendar in both directions, so subtracting several centuries gives the date as it would be written under today’s calendar, not the date used locally at the time.
Sources
- Which years are leap years and can you have leap seconds?, Royal Museums Greenwich.
- RFC 3339: Date and Time on the Internet: Timestamps (section 5.7, days in each month), Internet Engineering Task Force.