Parameter · Client Connection Defaults / Locale and Formatting
TimeZone
Sets the time zone for displaying and interpreting time stamps.
- Default:
GMT - Type: string
- Applies: Session (any user)
In plain words
PostgreSQL stores a timestamp with time zone as one absolute moment (internally UTC). TimeZone decides which local clock it is shown in, and which zone is assumed when you type a time without one.
Two users with different TimeZone settings see different clock times for the same row, and both are correct.
For DBAs and operators
The boot default is GMT, but initdb writes the server's system zone into postgresql.conf. Clients often override it per connection (libpq PGTZ, JDBC sends the JVM zone). It is reported to the client on change.
Accepted forms: a full IANA name (Europe/Berlin, list in pg_timezone_names), an abbreviation-free offset like +05:30 via SET TIME ZONE INTERVAL '+05:30' HOUR TO MINUTE, or a POSIX string. Beware the POSIX sign: SET TimeZone = 'UTC+5' means five hours west of Greenwich, so times print with -05. Prefer IANA names; they also follow daylight-saving rules.
What changes with TimeZone: output of timestamptz, casts between timestamp and timestamptz, now()::date, date_trunc('day', timestamptz), and therefore GROUP BY day reports. Nothing stored on disk changes. A functional index on (ts::date) for a timestamptz column is rejected because the cast depends on TimeZone.
The server log uses log_timezone instead, which is why log times and query results can differ.
SHOW TimeZone;
SELECT now(), now() AT TIME ZONE 'UTC';How to change it
Any user can change it for their session with SET.