This is a discussion on Change date / time locale on older versions within the MySQL forums, part of the Database Server Software category; --> I have to work with MySQL 4.1.20 and want to have Dutch localization for the date functions. So when ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have to work with MySQL 4.1.20 and want to have Dutch localization for the date functions. So when I select %W for a timestamp, I want "Maandag" instead of "Monday". For newer versions, the manual says: Beginning with MySQL 4.1.21, the locale indicated by the lc_time_names system variable controls the language used to display day and month names and abbreviations. This variable affects the output from the DATE_FORMAT(), DAYNAME() and MONTHNAME() functions. But how do I achieve this with older versions (specifically, 4.1.20)? Thanks for any help. Daan |
| ||||
| == Quote from Daan (daanstolp@gmail.com)'s article > I have to work with MySQL 4.1.20 and want to have Dutch localization > for the date functions. So when I select %W for a timestamp, I want > "Maandag" instead of "Monday". For newer versions, the manual says: > Beginning with MySQL 4.1.21, the locale indicated by the lc_time_names > system variable controls the language used to display day and month > names and abbreviations. This variable affects the output from the > DATE_FORMAT(), DAYNAME() and MONTHNAME() functions. > But how do I achieve this with older versions (specifically, 4.1.20)? > Thanks for any help. > Daan you can write a select statement with if in it. something like this: select if (date_format(timestamp_field, '%W')="Monday", 'Maandag', if (date_format(timestamp_field, '%W')="Tuesday", 'Torsdag' , blah blah)) from table1; this should work although a bit messy to get it all working. -- POST BY: lark with PHP News Reader |