Notes
- This variable is available starting with V4.3.1 in V4.3.x.
- This variable is available starting with V4.2.2 in V4.2.x.
Description
The lc_time_names variable specifies the language to be used for displaying date and month names and abbreviations.
Applicability
This variable applies only to the MySQL mode of OceanBase Database.
Privilege requirements
Query variables
Global level
In MySQL mode, the
systenant and all user tenants can query the value of global system variables by executing theSHOW VARIABLESstatement or querying theinformation_schema.GLOBAL_VARIABLESview.Session level
All
systenants and user tenants can view the value of a session-level system variable by using theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview in MySQL mode.
Modify variables
Global level
The
systenant can directly modify the value of a Global system variable.A MySQL user in a user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
In a user tenant, you can modify the value of a session-level system variable of the current tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | varchar |
| Default value | en_US |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Description
This variable affects the output of the DATE_FORMAT()、DAYNAME() and MONTHNAME() functions but does not affect the output of the STR_TO_DATE() or GET_FORMAT() functions.
Examples
For example:
Set the language for display date and month names and abbreviations to Chinese.
Session level
obclient> SET lc_time_names='zh_CN';Global level
obclient> SET GLOBAL lc_time_names='zh_CN';
Run the following statement to query the value of the
lc_time_namesvariable:obclient> show variables like "lc_time_names";The return result is as follows:
+---------------+-------+ | Variable_name | Value | +---------------+-------+ | lc_time_names | zh_CN | +---------------+-------+ 1 row in set (0.015 sec)Use the
DAYNAME()function to query the name of the week corresponding to the input date.obclient> select DAYNAME('2023-01-06');The result set is as follows:
+-----------------------+ | DAYNAME('2023-01-06') | +-----------------------+ | Friday | +-----------------------+ 1 row in set (0.000 sec)