Re: convert date in german format
| From: | Chris Boget | Date: | Wed, 26 Nov 2003 16:12:41 +0000 |
| Subject: | Re: convert date in german format | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31774@lists.php.net to get a copy of this message | ||
> 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 2 is to use UNIX_TIMESTAMP() in your query to retrieve the MySQL date
> formatted as a Unix timestamp. You can then pass this value to the PHP
> date() function and format it like you have above.
Or option 3: strtotime()
Chris