# Shift a date by an interval

Shape / columns

A variant of [Parse a date or time](https://meridian.online/operations/parse-a-date-or-time).

Add or subtract an amount of time to a date, time or timestamp.

Page: <https://meridian.online/operations/parse-a-date-or-time/shift-a-date-by-an-interval>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today.

## The DuckDB step

add or subtract an interval

```sql
CREATE TEMP TABLE result AS
SELECT DATE '2026-01-31' + INTERVAL 1 MONTH AS next_month, DATE '2026-03-01' - INTERVAL 1 DAY AS day_before,
       TIMESTAMP '2026-02-10 23:00:00' + INTERVAL 90 MINUTE AS later, DATE '2024-02-29' + INTERVAL 1 YEAR AS next_year;
SELECT * FROM result;
SELECT CASE WHEN ((SELECT next_month = TIMESTAMP '2026-02-28 00:00:00' AND day_before = TIMESTAMP '2026-02-28 00:00:00' AND later = TIMESTAMP '2026-02-11 00:30:00' AND next_year = TIMESTAMP '2025-02-28 00:00:00' FROM result)) THEN 'as expected' ELSE error('a month, a day, 90 minutes and a year were not added or subtracted to the dates as expected') END AS verdict;
```

The statement builds its own data.

It needs nothing installed beyond DuckDB itself.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).

- Duckle: [`Date Add`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/website/docs/components.html) (read 2026-09-25)
- Ibis: [`DateAdd`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/temporal.py) (read 2026-09-27)
- Ibis: [`DateSub`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/temporal.py) (read 2026-09-27)
- Ibis: [`TimeAdd`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/temporal.py) (read 2026-09-27)
- Ibis: [`TimeSub`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/temporal.py) (read 2026-09-27)
- Ibis: [`TimestampAdd`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/temporal.py) (read 2026-09-27)
- Ibis: [`TimestampSub`](https://github.com/ibis-project/ibis/blob/05d2b293344e86cb41c1a426071734f7e270335a/ibis/expr/operations/temporal.py) (read 2026-09-27)
- KNIME Analytics Platform: [`Date Shifter`](https://api.hub.knime.com/nodes/*TRyzM68BPCPSFm2H?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`Time Shifter`](https://api.hub.knime.com/nodes/*_lj-MFghefR5Hig6?details=full) (read 2026-09-27)
- RapidMiner Studio: [`Adjust Date`](https://docs.rapidminer.com/latest/studio/operators/blending/values/adjust_date.html) (read 2026-09-27)
