Bug #17512 Missing function for locale specific month and weekday names

Submitted: 17 Feb 2006 8:59 Modified: 21 Sep 2006 21:43
Reporter: Kristian Koehntopp Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.18 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[17 Feb 2006 8:59] Kristian Koehntopp
Description:
In porting code from Oracle to MySQL, we ran into the problem of getting names for weekdays and months for any given locale (not the servers locale, but any locale the client application needs).

We had to produce a stored function to simulate this.

How to repeat:
Try to find out in MySQL what the french or japanese name for the current month is.

Suggested fix:
Construct a standard set of functions for retrieval of these names from the locale data that is available to the operating system.

Make the syntax compliant with the standard, or if the standard does not say anything about this, do it the Oracle way.
[6 Mar 2006 12:21] Valeriy Kravchuk
Thank you for a reasonable feature request. I hope, some way to get proper locale-specific monthes and weekday names will be implemented eventually.
[21 Sep 2006 21:43] Peter Gulutzan
A patch for date_format is now in the server source code.
An example of how it works:

mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)

mysql> set lc_time_names='ja_JP';
Query OK, 0 rows affected (0.00 sec)

mysql> select date_format(s1,'%W') from t;
+----------------------+
| date_format(s1,'%W') |
+----------------------+
| 日曜日            |
+----------------------+
1 row in set (0.00 sec)

See also bug#9054.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.053 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.