Dates & Time
Date Add/Subtract Calculator
Enter your details
Runs in your browser
How to use it
Using the date add/subtract calculator
- 01
Set the starting date
Any calendar date from the picker works.
- 02
Choose direction, amount and unit
For example: subtract 2 years, or add 45 days.
- 03
Read the resulting date
Shown as yyyy-mm-dd; the rows restate exactly what operation was applied.
Good to know
The month-end clamping rule, explained
January 31 plus “one month” has no unambiguous answer because February never has a 31st. Libraries differ wildly: some roll into early March, others clamp. This calculator clamps; Jan 31 + 1 month = Feb 28 (or Feb 29 in a leap year); because that matches how billing cycles, leases and legal deadlines are conventionally measured.
Why ISO output
Formatting the result as yyyy-mm-dd removes ambiguity for international teams: “03/04/2026” means March 4 in one country and April 3 in another, while ISO reads identically everywhere and sorts correctly in spreadsheets.
Chaining operations
Need “three months after the contract ends, plus ten days”? Run the calculator twice, feeding each result into the next start field. Chaining keeps each step auditable instead of hiding it inside one compound formula.
How it's calculated
The math behind this calculator
Result = start ± amount × unit
Month-end rule: clamp the day to the target month’s last dayDays and weeks shift the underlying UTC timestamp directly. Months and years advance the calendar month (or twelve of them per year) while keeping your day-of-month; clamped down to the last valid day when the target month is shorter. That means Jan 31 + 1 month = Feb 28 in common years and Feb 29 in leap years, matching how contracts and subscriptions behave.
Assumptions & limitations
- Whole amounts only; fractional entries are rounded to integers.
- Clamping convention: overflow days are dropped, never rolled into the next month.
- Results are ISO yyyy-mm-dd calendar dates with no timezone component.
Worked example
Adding 1 month to 2024-01-31 lands on 2024-02-29; the leap-year clamp keeps the result inside February instead of spilling into March.
FAQ
Frequently asked questions
- What happens when adding a month overshoots a short month?
- The day is clamped to that month’s last day: Jan 31 + 1 month gives Feb 28 in common years and Feb 29 in leap years.
- Does subtracting work the same way?
- Yes; choose Subtract and the same clamp logic applies backwards, e.g. Mar 31 − 1 month = Feb 28/29.
- Can I enter fractional amounts?
- Amounts are rounded to whole units before computing; use days with a larger count instead of fractional months.
- Are timezones considered?
- No; dates are treated as pure UTC calendar dates, so the output is identical wherever you run it.
Keep exploring