Date Math Calculator

Add or subtract days, weeks, months or years from any date.

How this works

Pick a starting date, choose add or subtract, enter an amount, and choose a unit — the calculator returns the resulting date plus the day of the week. Days and weeks use straightforward arithmetic; months and years use the calendar so "1 month" means "next month, same day if it exists". Adding 1 month to 31 January lands on 28 February (or 29 in a leap year) because there's no 31st of February — same convention browsers and Excel use.

The formula

days → result = start + n × 1 day weeks → result = start + n × 7 days months → result.month = start.month + n (day clamped to last valid) years → result.year = start.year + n (day clamped to last valid)

For days/weeks the calculator uses millisecond arithmetic anchored at noon, so DST transitions (typically at 02:00) don't bump the date. For months/years it uses the platform's Date.setMonth / setFullYear, which clamps to the last valid day automatically (e.g. 31 Jan + 1 month → 28/29 Feb). Subtraction works the same way with a negative sign — 1 March − 1 month is 1 February, not 28/29 Feb.

Example calculation

  • Start: 28 April 2026 (Tuesday). Add 30 days.
  • Result: 28 May 2026 (Thursday).
  • Start: 31 January 2026. Add 1 month → 28 February 2026 (day clamps because there's no 31 Feb).
  • Start: 31 January 2024. Add 1 month → 29 February 2024 (leap year).

Frequently asked questions

How does adding months handle "31 of February"?

It clamps to the last valid day of the target month. 31 Jan + 1 month → 28 Feb in a normal year, 29 Feb in a leap year. This is the same convention browsers, Excel, and most date libraries use, but be aware it's lossy: 31 Jan + 1 month + 1 month is 28 Mar (or 29 Mar in a leap year), not 31 Mar — the original "31" gets forgotten by the second hop.

Why anchor calculations at noon?

Daylight Saving Time transitions are typically at 02:00 local time. If you ran day arithmetic on a midnight-anchored date and crossed a DST boundary, the result could land on the wrong day because the day in question is 23 or 25 hours long, not 24. Anchoring at noon stays safely away from those transitions, so 1 day always means 24 hours regardless of DST.

What's the difference between this and the Working Days calc?

This calculator just does calendar arithmetic — adding 30 days could land on a Saturday, Sunday, or holiday and we don't filter those out. The Working Days calculator counts the number of business days (Mon–Fri) between two dates instead. If you need "30 working days from today", you'd combine them: increment day-by-day with this calc until the working-days count reaches 30 — or wait for a future calc that does the inversion directly.

Related calculators