Menu

PostgreSQL timestamptz: UTC Storage and Time Zone Conversion

Updated on

PostgreSQL timestamptz is an abbreviation for timestamp with time zone. It represents an instant: PostgreSQL converts time-zone-aware input to UTC for storage, then converts it to the current session TimeZone for output. It does not retain the original zone name or offset. If an application needs the original region, such as America/New_York, store that identifier separately. See PostgreSQL’s date/time type documentation.

Define and insert a timestamptz value

CREATE TABLE events (
    event_id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    event_at timestamptz NOT NULL
);

INSERT INTO events (event_at)
VALUES ('2026-01-15 14:00:00-05:00');

That input is the same instant as 2026-01-15 19:00:00+00. To make the displayed value predictable in a query, set the session time zone explicitly:

SET TIME ZONE 'UTC';

SELECT event_at
FROM events;

The output is 2026-01-15 19:00:00+00. If the session’s TimeZone changes, PostgreSQL displays the same stored instant in the newly selected zone. For a specific local view, use AT TIME ZONE:

SELECT event_at AT TIME ZONE 'America/New_York' AS event_local
FROM events;

For the example value, this returns 2026-01-15 14:00:00 as a timestamp without time zone.

Input without an offset

When a timestamp input has no time-zone offset, PostgreSQL interprets it using the session TimeZone, then stores the corresponding UTC instant. If the value is intended to remain a wall-clock reading regardless of session settings, compare timestamp without time zone. If the application must later reproduce a named region’s daylight-saving rules, store the region identifier separately; a timestamptz value alone cannot recover it.

For date/time ranges and time-zone conversion rules, see PostgreSQL’s date/time types reference and AT TIME ZONE documentation.