↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Date/Time Functions And Operators

date_subtract

Read the PG 18 manual

Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted.

Reading PG 18current·documented in 5 of 27 versions, 16 to 20

Signatures & examples

date_subtract ( timestamp with time zone, interval [, text ] ) → timestamp with time zone
Subtract an interval from a timestamp with time zone, computing times of day and daylight-savings adjustments according to the time zone named by the third argument, or the current TimeZone setting if that is omitted. The form with two arguments is equivalent to the timestamp with time zone - interval operator.
date_subtract('2021-11-01 00:00:00+01'::timestamptz, '1 day'::interval, 'Europe/Warsaw') → 2021-10-30 22:00:00+00
Version history 1
  1. 15 → 16 added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source