Note
This variable is introduced since OceanBase Database V4.2.2.
Description
lc_time_names specifies the language in which date and month names and their abbreviations are displayed.
Applicability
This variable is applicable only to OceanBase Database in MySQL mode.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | en_US |
| Value range |
|
| Applicable scope |
|
| Modifiable | Yes. You can use the SET statement to modify the variable. |
Considerations
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() function.
Examples
Take the output of a date function as an example:
Set the language in which the date and month names and their abbreviations are displayed to English.
Set the variable at the session level as follows:
obclient> SET lc_time_names='en_US';Set the variable at the global level as follows:
obclient> SET GLOBAL lc_time_names='en_US';
Query 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 | en_US | +---------------+-------+ 1 row in set (0.015 sec)Use the
DAYNAME()function to query the day of the week of 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)