Overview
lc_time_names specifies the language for displaying date and month names and their abbreviations.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.GLOBAL_VARIABLESview to view the values of global system variables.Session level
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.SESSION_VARIABLESview to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session expiration
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Varchar |
| Default Value | en_US |
| Value range |
|
| Effective Scope |
|
| Modifiable | Yes, you can use theSETStatement modification. |
Usage instructions
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.
Configuration example
Take the display of the result of a date function in Chinese as an example:
Set the language to Chinese for displaying date, month names, and their abbreviations.
Session expiration
obclient> SET lc_time_names='zh_CN';Global effective
obclient> SET GLOBAL lc_time_names='zh_CN';
Check 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)Use the
DAYNAME()function to query the weekday corresponding to the input date.obclient> select DAYNAME('2023-01-06');The return result is as follows:
+-----------------------+ | DAYNAME('2023-01-06') | +-----------------------+ | Friday | +-----------------------+ 1 row in set (0.000 sec)