# 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.

- Endpoint: `POST https://setget.net/v1/tools/date-add` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `date-add`
- Page: https://setget.net/tools/date-add

## Inputs

- `date` (required, string): The starting date or date and time.
- `years` (optional, integer, default `0`, range -9999..9999): Years to add. Negative numbers subtract.
- `months` (optional, integer, default `0`, range -120000..120000): Months to add. Negative numbers subtract.
- `weeks` (optional, integer, default `0`, range -520000..520000): Weeks to add. Negative numbers subtract.
- `days` (optional, integer, default `0`, range -3660000..3660000): Days to add. Negative numbers subtract.
- `hours` (optional, integer, default `0`, range -90000000..90000000): Hours to add. Negative numbers subtract.
- `minutes` (optional, integer, default `0`, range -90000000..90000000): Minutes to add. Negative numbers subtract.

## Example 1

```json
{"input":{"date":"2026-01-31","months":1}}
```

Result:

```json
{"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."}
```

## Example 2: Days and hours

```json
{"input":{"date":"2026-03-05 09:00","days":10,"hours":-2}}
```

Result:

```json
{"result":"2026-03-15T07:00:00","weekday":"Sunday","clamped":false,"note":null}
```

**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.
