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
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
> 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
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
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
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));
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