Add or subtract days, months, and years from any date

Move a timestamp by selected calendar components in the browser’s local time zone.

freeworks offlinenothing uploaded
ToolDate Add/Subtract
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

Years, months, days, hours, minutes, and seconds are applied in sequence with the corresponding local Date setters. ECMAScript normalizes overflow, so changing the month field can carry surplus days into the following month.

  • Every component begins at zero and the initial operation is addition.
  • This is local calendar-component arithmetic, not one fixed millisecond duration.

Worked example

Add one calendar month
Move January 15 forward by one month
Input
											Input: 2025-01-15T00:00:00Z
Months: 1
										
Output
												Original: 2025-01-15T00:00:00.000Z
Result:   2025-02-15T00:00:00.000Z
											

When to use this

Renewal dates advance by calendar months, reminders move by local days and hours, and test suites explore JavaScript Date overflow.

Edge cases

  • Adding one month to 31 January can overflow through February into March instead of clamping to February’s last day.
  • Adding one local day across a daylight-saving change can represent 23 or 25 elapsed hours.
  • Components are applied sequentially, so a combined month-and-day change can differ from adding one precomputed duration.

References