On this page (11)
How to use this calculator#
- Set the start date and the directionAdd moves forward, subtract moves back. Every unit you enter is applied in the chosen direction, so there is no need to type negative numbers.
- Use days for anything defined in daysNet 30, 90-day return windows, 14-day cooling-off periods and 180-day visa limits are all day counts in their governing text. Entering ‘3 months’ instead of ‘90 days’ can shift the answer by two days.
- Use months and years for anniversariesRenewals, notice periods and subscription terms are calendar-based. A one-year term starting 10 May 2027 ends 10 May 2028, which is 366 days because 2028 is a leap year.
- Check the weekday of the resultA deadline landing on a Saturday or a public holiday frequently moves to the next business day under the terms of the agreement — occasionally to the previous one. Either way, the calendar date alone is not the whole answer.
The formula#
Ordered date arithmetic with month-end clamping
Result = clamp(Start + Y years + M months) + (W × 7 + D) days, where clamp caps the day number at the length of the target month
- Start
- The date you begin from
- Y
- Years to add or subtract — a calendar unit, so its length depends on the start date
- M
- Months to add or subtract, applied after years and subject to clamping
- W
- Weeks, always exactly 7 days each
- D
- Days, added last as pure arithmetic
- clamp
- If the resulting day number exceeds the days in the target month, use the last day of that month instead
Order matters and the coarse units go first, matching how contracts phrase periods such as ‘three months and ten days from signing’. Clamping is the same convention used by spreadsheet EDATE functions and by lenders setting payment dates. It makes month arithmetic non-reversible: 31 January plus one month is 28 February, and 28 February minus one month is 28 January, so the round trip loses three days. Leap years are handled by the calendar itself — one year after 29 February 2028 clamps to 28 February 2029.
The order the units are applied#
Years are applied first, then months, then weeks and days last. Order matters more than people expect: starting from 31 January, adding one month then 30 days is not the same as adding 30 days then one month. Applying the coarse units before the fine ones matches how contracts and statutes describe periods such as ‘three months and ten days from signing’.
Days and weeks are pure arithmetic — a week is always exactly 7 days, so 6 weeks is 42 days regardless of which months the span crosses. Months and years are calendar units, so their length depends on where you start. Adding 1 year to 10 May 2027 lands on 10 May 2028, a jump of 366 days because 2028 is a leap year.
Month-end rollover explained#
Adding one month to 31 January is ambiguous because February has no 31st. This calculator clamps to the last valid day of the target month, returning 28 February (or 29 in a leap year) rather than spilling forward into 2 or 3 March. Clamping is the convention used by most spreadsheet EDATE functions and by lenders setting payment dates.
The same rule applies in reverse. Subtracting one month from 31 March gives 28 February, and adding one month to 31 August gives 30 September. Be aware the operation is not always reversible: adding a month to 31 January and then subtracting a month returns 28 January, not the original 31st.
Common uses for date arithmetic#
Net-30 and net-60 invoice terms, 90-day return windows, 14-day cancellation periods and 180-day visa limits are all day-based, so use the days field for these. A 90-day window opened on 15 October 2027 closes on 13 January 2028. Contract renewals, subscription anniversaries and notice periods are usually month or year based instead.
The weekday of the result is worth checking before you commit to it. A deadline that lands on a Saturday or a public holiday often moves to the next business day under the terms of the agreement, which can quietly buy you an extra day or two — or cost you one, if the rule moves the date backwards instead.
Worked examples#
A 90-day invoice window
An invoice issued on 15 October 2027 with 90-day terms.
- October has 31 days, so 31 − 15 = 16 days remain in October — running total 16
- November adds 30 → running total 46
- December adds 31 → running total 77
- 90 − 77 = 13, so the date falls on 13 January 2028
- 13 January 2028 is a Thursday
Thursday 13 January 2028. Three calendar months from the same date would be 15 January — two days later.
Month-end clamping, and why it does not reverse
Adding and then subtracting one month from 31 January.
- 31 January 2027 + 1 month: February 2027 has 28 days, so clamp to 28 February 2027
- 31 January 2028 + 1 month: February 2028 has 29 days, so clamp to 29 February 2028
- Now take 28 February 2027 − 1 month: January has 31 days, the 28th exists, so the answer is 28 January 2027
- The original 31st is gone
28 February 2027 and 29 February 2028. Adding a month and subtracting it again returns 28 January, three days short of where you started.
Reference tables#
| Days added | Resulting date | Weekday |
|---|---|---|
| 7 | 8 January 2027 | Friday |
| 14 | 15 January 2027 | Friday |
| 30 | 31 January 2027 | Sunday |
| 45 | 15 February 2027 | Monday |
| 60 | 2 March 2027 | Tuesday |
| 90 | 1 April 2027 | Thursday |
| 120 | 1 May 2027 | Saturday |
| 180 | 30 June 2027 | Wednesday |
| 365 | 1 January 2028 | Saturday |
Every multiple of 7 lands on the same weekday, which is why 7, 14, 21 and 28 days are all Fridays here. Adding 365 days shifts the weekday by exactly one, because 365 = 52 × 7 + 1.
| Start | + 1 month, common year | + 1 month, leap year |
|---|---|---|
| 29 January | 28 February | 29 February |
| 30 January | 28 February | 29 February |
| 31 January | 28 February | 29 February |
| 28 February | 28 March | 28 March |
| 31 March | 30 April | 30 April |
| 31 May | 30 June | 30 June |
| 31 August | 30 September | 30 September |
| 31 October | 30 November | 30 November |
| 31 December | 31 January | 31 January |
Three different January dates all collapse onto 28 February, which is exactly why the operation cannot be undone. Some financial contracts use an ‘end-of-month’ rule instead, where the last day of one month always maps to the last day of the next — under that rule 28 February would map to 31 March, not 28 March.
Common mistakes#
- Treating 30 days as one monthOnly April, June, September and November have 30 days. A 30-day term from 31 January 2027 ends on 2 March, whereas one calendar month ends on 28 February — a four-day gap on a payment deadline, and the reason Net 30 is written in days rather than months.
- Applying the units in the wrong orderFrom 31 January, adding one month then 30 days gives 30 March; adding 30 days then one month gives 2 April. Both are defensible readings of ‘a month and thirty days’, which is why the order has to be stated and why this tool applies years and months before weeks and days.
- Assuming date arithmetic is reversibleAdding a month and then subtracting one does not always return the start date. Anywhere a schedule is generated by repeatedly adding a month — loan payments, subscription renewals — always generate from the original date rather than iterating from the last result, or a 31st will drift to a 28th and stay there.
- Ignoring the weekday the result lands onA deadline falling on a weekend or public holiday usually moves under the agreement's own rules, and different agreements move it in different directions. Checking the weekday is what turns a calculated date into a usable one.
Frequently asked questions#
What happens when I add a month to 31 January?
The result clamps to the last day of February — 28th in a common year, 29th in a leap year — rather than rolling over into March.
Can I combine several units at once?
Yes. Enter any mix of years, months, weeks and days; years and months are applied first, then weeks and days are added as an exact number of days.
How do I subtract time instead of adding it?
Switch the toggle to subtract. Every unit you have entered is then applied backwards from the start date.
Is adding 12 months the same as adding 1 year?
Yes, for every date except 29 February. Adding 1 year to 29 February 2028 clamps to 28 February 2029, which matches what adding 12 months returns.
Key terms#
- Clamping
- Capping the resulting day number at the last valid day of the target month, so 31 January plus a month becomes 28 or 29 February rather than spilling into March.
- EDATE
- The spreadsheet function that adds whole months to a date using the same clamping rule this calculator uses.
- End-of-month rule
- An alternative convention, common in finance, where a date falling on the last day of a month always maps to the last day of the target month.
- Anniversary date
- The same day and month in a later year — the basis for renewals, notice periods and annual terms.
- Net terms
- Payment windows expressed in days from the invoice date: Net 30, Net 60, Net 90. Always day counts, never calendar months.
- Calendar unit vs elapsed unit
- Years and months are calendar units whose length depends on where you start. Weeks and days are elapsed units of fixed size.
Sources#
- ISO 8601 date and time format, including duration syntax — International Organization for Standardization
- RFC 3339 — Date and Time on the Internet: Timestamps — IETF
- Federal holidays by date — US Office of Personnel Management
Figures last checked .
Put this calculator on your site
Free, no sign-up, and no attribution fee — just keep the credit line that comes with the code. The calculator stays up to date automatically.
