Re: Date Formatting

From: Date: Fri, 13 Dec 2002 19:11:52 +0000
Subject: Re: Date Formatting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128191@lists.php.net to get a copy of this message
Just a small question, but why not just do this through the SQL statement instead of using php? http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1295 [from the mysql manual] mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y'); -> 'Saturday October 1997' mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s'); -> '22:23:00' mysql> SELECT DATE_FORMAT('1997-10-04 22:23:00', '%D %y %a %d %m %b %j'); -> '4th 97 Sat 04 10 Oct 277' ----- Original Message ----- From: "Clint Tredway" <ctredway@fishermenstudios.com> To: <php-general@lists.php.net> Sent: Friday, December 13, 2002 11:55 AM Subject: [PHP] Date Formatting How can I format a date coming out of a MySQL? I know how to format today's date but not a date coming out of MySQL. I have looked through the manual, but I must be blind because I cannot figure it out. Thanks, Clint

« previous php.general (#128191) next »