PostgreSQL 18 reference · Date and Time Functions
PostgreSQL AT TIME ZONE Operator
Convert between time zones: timestamptz AT TIME ZONE 'Asia/Tokyo' shows local time there.
PostgreSQL 18
Syntax
timestamptz AT TIME ZONE zone | timestamp AT TIME ZONE zone | timestamptz AT LOCAL
Parameters
| Parameter | Description |
|---|---|
zone |
A time zone name such as 'Europe/London', or an offset. |
Return value
timestamp (from timestamptz) or timestamptz (from timestamp).
Examples
SELECT TIMESTAMPTZ '2026-03-09 12:00+00' AT TIME ZONE 'Asia/Tokyo' AS tokyo,
TIMESTAMPTZ '2026-03-09 12:00+00' AT TIME ZONE 'America/New_York' AS new_york;
Output
tokyo | new_york ---------------------+--------------------- 2026-03-09 21:00:00 | 2026-03-09 08:00:00 (1 row)
Run this on your computer — see “Get Started” for setup.
SELECT TIMESTAMP '2026-03-09 09:00' AT TIME ZONE 'Europe/Paris' AS paris_9am_in_utc;
Output
paris_9am_in_utc ------------------------ 2026-03-09 08:00:00+00 (1 row)
Run this on your computer — see “Get Started” for setup.
Version history
| Version | Change |
|---|---|
| PostgreSQL 17 | AT LOCAL converts to the session's time zone. |
Related
NOW()· Return the current date and time with time zone, fixed at the start of the transaction. current_timestamp is the same.TO_CHAR()· Format a date, timestamp or number as text with a pattern such as 'DD Mon YYYY' or 'FM999,990.00'.- SQL Date Functions · tutorial