Add or Subtract Time from a Date
Add or take away years, months, weeks and days from a date, with month ends handled the way people mean them.
Move a date forward or back by a span you describe in years, months, weeks and days. Every part is optional, and they combine.
How it works
Years and months are applied first, as months. If the day of the month does not exist in the month you land on, it is clamped to the last day of that month: one month after 31 January is 28 February, or 29 February in a leap year.
Weeks and days are then added as plain days, after the clamp, so they always move the date by exactly the number of days you asked for.
The order matters and it is not arbitrary. Months first, then days, is the convention every calendar application uses, and it is the only one under which adding a month and then a day gives the same answer as a person would.
Examples
| Case | Input | Result |
|---|---|---|
| A month added to the last day of January | 2026-01-31, add 1 month | 2026-02-28, a Saturday |
Frequently asked questions
Why is one month after 31 January not 3 March?
Because that is an overflow, not a date. PHP produces it by adding one to the month and keeping day 31, which February cannot hold. Clamping to 28 February is what a contract, a rent cycle and a person all mean by "in one month".
Are the results affected by time zones or daylight saving?
No. The arithmetic runs on calendar dates in UTC, so a day is always a day. If you need a specific instant moved between zones, the time zone converter is the right tool.
Does it skip weekends or holidays?
No, every day counts. Counting only working days is a different question, and the working days calculator answers it with a working week and a holiday list you supply.
Good to know
- Dates are handled as calendar dates in UTC; no time zone or daylight saving adjustment is applied.
- Adding then subtracting the same span does not always return to the starting date. That is a property of month lengths, not a defect: once 31 January has been clamped to 28 February, the information that it was the 31st is gone.