Re: convert date in german format

From: Date: Wed, 26 Nov 2003 16:08:19 +0000
Subject: Re: convert date in german format
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31771@lists.php.net to get a copy of this message
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)); if that doesn't work (strtotime will return -1 if it fails, which will end up looking like 31.12.69 when date() renders it), then you may need to either a) use MySQL's UNIX_TIMESTAMP() function in your query to convert your date to a unix timestamp or b) use preg_match() and mktime() to create the unix timestamp from the MYSQL data. Hans

Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
« previous php.db (#31771) next »