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
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_GLOBAL_VARIABLEview (in Oracle-compatible mode) or theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode) to query the value of a global system variable.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle-compatible mode) or theinformation_schema.SESSION_VARIABLESview (in MySQL-compatible mode) to query the value of a session variable.
Modify variables
Global level
The
systenant can directly modify the value of a global system variable.MySQL-compatible 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.
Session level
The
systenant 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 |
|
| 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';