Re: [PHP-DB] convert date in german format

2003-11-26 Thread CPT John W. Holmes
From: "Hans Lellelid" <[EMAIL PROTECTED]> > Using MySQL DATE_FORMAT() would work, but it's a hack solution; if you > ever wanted to create an English version of your site you would have to > make changes to your data-layer queries -- and that's just not where > that logic belongs. So use UNIX_TIM

Re: [PHP-DB] convert date in german format

2003-11-26 Thread Hans Lellelid
at the top of your script, do: setlocale ( LC_TIME, 'de_DE' ) ; (assumes your machine has German support installed) Yes, this is really the "right" way to do date display for different locales, but it also requries that you use the strftime() function instead of date(). Like date(), strftime

Re: [PHP-DB] convert date in german format

2003-11-26 Thread Chris Boget
> That's because date() wants a Unix timestamp. MySQL has it's own format. > You have two options. Option 1 is to use DATE_FORMAT() in your query to > retrieve the date already formated. DATE_FORMAT() works similar to the PHP > date() function. Look it up in Chapter 6 of the MySQL Manual. > Option

Re: [PHP-DB] convert date in german format

2003-11-26 Thread CPT John W. Holmes
From: "Ruprecht Helms" <[EMAIL PROTECTED]> > how can I convert a date stored in a mysql-database for output > in the german format (dd.mm.yy). > > I tried date ("d.m.y",$row->from); > > but I still get the english-format stored in the database. > The databasefield is type date. That's because dat

Re: [PHP-DB] convert date in german format

2003-11-26 Thread Ignatius Reilly
dnesday, November 26, 2003 16:58 Subject: [PHP-DB] convert date in german format > Hi, > > how can I convert a date stored in a mysql-database for output > in the german format (dd.mm.yy). > > I tried date ("d.m.y",$row->from); > > but I still get the eng

Re: [PHP-DB] convert date in german format

2003-11-26 Thread Hans Lellelid
how can I convert a date stored in a mysql-database for output in the german format (dd.mm.yy). I tried date ("d.m.y",$row->from); the second parameter to date() should be a unix timestamp (integer). Did you convert your MySQL date to a timestamp? Try: date("d.m.y", strtotime($row->from));

[PHP-DB] convert date in german format

2003-11-26 Thread Ruprecht Helms
Hi, how can I convert a date stored in a mysql-database for output in the german format (dd.mm.yy). I tried date ("d.m.y",$row->from); but I still get the english-format stored in the database. The databasefield is type date. Regards, Ruprecht -- PHP Database Mailing List (http://www.php.ne