Add or subtract time from a date

Add or subtract years, months, weeks, days, hours and minutes from a date and get the resulting date.

Input

The starting date or date and time.
Years to add. Negative numbers subtract.
Months to add. Negative numbers subtract.
Weeks to add. Negative numbers subtract.
Days to add. Negative numbers subtract.
Hours to add. Negative numbers subtract.
Minutes to add. Negative numbers subtract.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/date-add \
  -H 'Content-Type: application/json' \
  -d '{"input":{"date":"2026-01-31","months":1}}'
import json, urllib.request

body = {'input': {'date': '2026-01-31', 'months': 1}}
request = urllib.request.Request("https://setget.net/v1/tools/date-add", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/date-add", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"date":"2026-01-31","months":1}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "date-add",
  "input": {
    "date": "2026-01-31",
    "months": 1
  }
}
{
  "input": {
    "date": "2026-01-31",
    "months": 1
  }
}

Endpoint: POST /v1/tools/date-add. Over MCP: run_tool with slug: "date-add". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
date string yes The starting date or date and time.
years integer no Years to add. Negative numbers subtract. Default: 0. From -9999 to 9999.
months integer no Months to add. Negative numbers subtract. Default: 0. From -120000 to 120000.
weeks integer no Weeks to add. Negative numbers subtract. Default: 0. From -520000 to 520000.
days integer no Days to add. Negative numbers subtract. Default: 0. From -3660000 to 3660000.
hours integer no Hours to add. Negative numbers subtract. Default: 0. From -90000000 to 90000000.
minutes integer no Minutes to add. Negative numbers subtract. Default: 0. From -90000000 to 90000000.

Examples

Input
{
  "date": "2026-01-31",
  "months": 1
}
Result
{
  "result": "2026-02-28",
  "weekday": "Saturday",
  "clamped": true,
  "note": "February 2026 has no day 31, so the last day of the month (28) was used."
}

Days and hours

Input
{
  "date": "2026-03-05 09:00",
  "days": 10,
  "hours": -2
}
Result
{
  "result": "2026-03-15T07:00:00",
  "weekday": "Sunday",
  "clamped": false,
  "note": null
}

Questions

What happens at the end of a month?
Adding a month to 31 January gives 28 February (29 in a leap year), because February has no 31st. The answer is clamped to the last day of the shorter month, and "clamped" is true.
In what order are the parts added?
Years and months first, then weeks, days, hours and minutes.
Does it follow daylight saving?
No. It works on the clock time as written. Use timezone-convert to move the result between zones.