Note
- 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
lc_time_names specifies the language to use for displaying the names and abbreviations of dates and months.
Applicability
This variable applies only to OceanBase Database in MySQL-compatible mode.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to view the values of Global system variables.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to view the values of Session system variables.
Modify variables
Global level
systenants can directly modify the values of Global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of Global system variables.
Session level
systenants and all user tenants can directly modify the values of Session system variables.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Varchar |
| Default value | en_US |
| Value range |
|
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage notes
This variable affects the output of the DATE_FORMAT(), DAYNAME(), and MONTHNAME() functions but does not affect the results of the STR_TO_DATE() or GET_FORMAT() functions.
Examples
Assume that you want to display the result of a date function in Chinese.
Set the language to Chinese for displaying the names and abbreviations of dates and months.
Session level
obclient> SET lc_time_names='zh_CN';Global level
obclient> SET GLOBAL lc_time_names='zh_CN';
View the current value of
lc_time_names.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)Query the name of the weekday corresponding to the input date by using the
DAYNAME()function.obclient> select DAYNAME('2023-01-06');The return result is as follows:
+-----------------------+ | DAYNAME('2023-01-06') | +-----------------------+ | Friday | +-----------------------+ 1 row in set (0.000 sec)