Download PDFSubmit Feedback

  • Privileges
  • Syntax
  • Parameters
  • Examples

Time Zone Management

You can use the SET TIME ZONE SQL statement to modify the time zone of the current session.

Privileges

No privileges required.

Syntax

SET TIME ZONE [ <int> | '<location>'];

Parameters

ParameterDescription
intThe time difference from UTC, ranging from [-12, 14] (UTC-12 to UTC+14).
locationThe name of the time zone, such as Asia/Shanghai.

Examples

  1. Set the session's time zone to UTC+8.

    SET TIME ZONE 8;
    
  2. Verify the time zone setting:

    SHOW TIME ZONE;
    timezone
    
    ---
    8
    (1 row)