Note
- This variable was introduced in V4.3.1 of V4.3.x.
- This variable was introduced in V4.2.2 of V4.2.x.
Description
lc_time_names specifies the language for displaying the names and abbreviations of dates and months.
Applicability
This variable applies only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
Global level
sysand all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the value of a Global system variable.Session level
sysand all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL mode) to view the value of a Session system variable.
Modify variables
Global level
systenants 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.
Session level
sysand all user tenants can directly modify the value of a Session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | varchar |
| Default value | en_US |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Considerations
This variable affects the output of the DATE_FORMAT(), DAYNAME(), and MONTHNAME() functions but does not affect the result of the STR_TO_DATE() or GET_FORMAT() function.
Examples
Assume that you want to display the result of a date function in Chinese:
Set the language for displaying the names and abbreviations of dates and months to Chinese.
Session level
obclient> SET lc_time_names='zh_CN';Global level
obclient> SET GLOBAL lc_time_names='zh_CN';
View the value of
lc_time_names.obclient> show variables like "lc_time_names";The returned result is as follows:
+---------------+-------+ | Variable_name | Value | +---------------+-------+ | lc_time_names | zh_CN | +---------------+-------+ 1 row in set (0.015 sec)Query the name of the day corresponding to the input date by using the
DAYNAME()function.obclient> select DAYNAME('2023-01-06');The returned result is as follows:
+-----------------------+ | DAYNAME('2023-01-06') | +-----------------------+ | Friday | +-----------------------+ 1 row in set (0.000 sec)