Unix Technical Forum

Change date / time locale on older versions

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:02 AM
Daan
 
Posts: n/a
Default Change date / time locale on older versions

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:02 AM
lark
 
Posts: n/a
Default Re: Change date / time locale on older versions

== 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:18 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com