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

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.

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. PG 15 → 16added

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