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 view the SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE view (in Oracle mode) or the information_schema.GLOBAL_VARIABLES view (in MySQL 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 view the SYS.TENANT_VIRTUAL_SESSION_VARIABLE view (in Oracle mode) or the information_schema.SESSION_VARIABLES view (in MySQL mode) to query the value of a session system variable.
Modify variables
Set the variable at the global level
The
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
For V4.x, starting from V4.2.0, Oracle user tenants must have the
ALTER SYSTEMprivilege to modify the value of a global system variable.- Set the variable at the 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 |
|---|---|
| Type | varchar |
| Default value | +8:00 |
| Value range | -12:59 ~ +13:00 |
| Effective scope |
| Modifiable | Yes. You can use the SET statement to modify the value.|
Examples
Set the variable at the session level
obclient> SET time_zone='+08:00';Set the variable at the global level
obclient> SET GLOBAL time_zone='+08:00';
