Subtracts the specified interval from the current timestamp, and returns it as a TIMESTAMPTZ value. For more information, see Arithmetic with intervals.

Syntax

AGO(<interval>)

Parameters

ParameterDescription
<interval>An interval literal representing substracted a duration.

Return Type

TIMESTAMPTZ

Example

The following example assumes that the current Unix timestamp is 2023-03-03 14:42:31.123456 UTC.

SET time_zone = 'Europe/Berlin';
SELECT CURRENT_TIMESTAMP;  --> 2023-03-03 15:42:31.123456+01
SELECT AGO('1h');  --> 2023-03-03 14:42:31.123456+01