time_zone

2025-11-14 07:33:33  Updated

Note

This variable was introduced in V1.4.

Description

The time_zone variable specifies the time zone for the current session of a tenant. Valid values are in the '+08:00' offset format or the Asia/Shanghai region format.

Privilege requirements

  • Query variables

    • Global level

      The sys tenant and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE view (in Oracle-compatible mode) or the information_schema.GLOBAL_VARIABLES view (in MySQL-compatible mode) to query the value of a global system variable.

    • Session level

      The sys tenant and all user tenants can execute the SHOW VARIABLES statement or query the SYS.TENANT_VIRTUAL_SESSION_VARIABLE view (in Oracle-compatible mode) or the information_schema.SESSION_VARIABLES view (in MySQL-compatible mode) to query the value of a session variable.

  • Modify variables

    • Global level

      • The sys tenant can directly modify the value of a global system variable.

      • MySQL-compatible tenants must have the SUPER or ALTER SYSTEM privilege to modify the value of a global system variable.

      • For V4.x, starting from V4.2.0, Oracle user tenants must have the ALTER SYSTEM privilege to modify the value of a global system variable.

    • Session level

      The sys tenant and all user tenants can directly modify the value of a session system variable in their own tenant.

Attributes

Attribute Description
Parameter type Varchar
Default value +8:00
Value range -12:59 ~ +13:00
Scope
  • Global
  • Session
Modifiable Yes. You can use the SET statement to modify the value.

Examples

Set the time zone used by the current tenant session to +08:00.

  • Session level

    obclient> SET time_zone='+08:00';
    
  • Global level

    obclient> SET GLOBAL time_zone='+08:00';
    

Contact Us