Date Add / Subtract: How It Works
Adding a period to a date is unambiguous in days and genuinely ambiguous in months, because months are not a fixed length. This page explains what happens at the awkward boundaries and how deadlines are usually counted in practice.
Days are simple; months are not
Adding days is straightforward — the calendar advances, leap days included automatically. Adding months has to answer a question with no single right answer: what is one month after 31 January?
| Approach | 31 Jan + 1 month | Used by |
|---|---|---|
| Clamp to month end | 28 or 29 February | Most software and most legal drafting |
| Overflow | 3 March | Some naive implementations |
Clamping is the standard and the more sensible one: it keeps the result inside the intended month. It also means the operation is not reversible — 31 January plus one month is 28 February, and 28 February minus one month is 28 January, not 31.
If exactness matters, work in days. 'Within 30 days' is unambiguous; 'within one month' requires a convention.
Business days
Adding working days skips weekends and, where configured, public holidays. This is how most legal and commercial deadlines are expressed, and the details vary:
- The start date itself is usually excluded — 'within 5 business days' from Monday typically means the following Monday.
- Holiday calendars differ by country and region, and some holidays shift to the next Monday when they fall at a weekend.
- Some jurisdictions define business days by court sitting days rather than by weekends.
For a deadline with consequences, confirm the definition in the governing document rather than assuming.
End-of-month rules
Financial contracts commonly use an explicit end-of-month convention: if the start date is the last day of a month, every subsequent date is also the last day of its month. Under that rule, a monthly series starting 31 January runs 28/29 February, 31 March, 30 April. Without it, the series would be pinned to the 28th after February — which is why the convention exists.
Common uses
| Task | Typical basis |
|---|---|
| Contract notice period | Calendar days or months, as drafted |
| Invoice due date | Calendar days from invoice date |
| Statutory response deadline | Business days, jurisdiction-specific |
| Warranty and guarantee expiry | Months or years from purchase |
| Prescription or renewal reminder | Days |
| Project milestones | Business days |
Leap years and February
Adding one year to 29 February gives 28 February in a common year under the clamping rule. Adding four years returns 29 February. This matters for anniversary-based calculations such as insurance renewals and age thresholds, where a policy or eligibility rule may specify which applies.
Time zones
Adding days to a date is unaffected by time zones, but the resulting instant is not. A deadline of '30 days from today, end of business' means different moments in different places. Contracts crossing borders should name the applicable time zone explicitly — otherwise the last day is genuinely disputable.