RE: [PHP] Formatting date from a database date value
| From: | Cosenza, Mario | Date: | Thu, 27 Jul 2000 18:49:57 +0000 |
| Subject: | RE: [PHP] Formatting date from a database date value | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8640@lists.php.net to get a copy of this message | ||
I had to structure my query to reformat the date. I felt that was easier
than re-shuffling it with PHP.
Check out the MySQL documentation at
http://www.mysql.com/documentation/mysql/commented/manual.php?section=Date_a
nd_time_functions for the format string you're looking for.
But, basically it's like this..
SELECT DATE_FORMAT(<datefield>, "%m-%d-%y") FROM <table> WHERE <blah, blah,
blah>
Hope it helps,
Mario
-----Original Message-----
From: Jack Sasportas [mailto:jack@innovativeinternet.com]
Sent: Thursday, July 27, 2000 2:17 PM
To: php
Subject: [PHP] Formatting date from a database date value
I have searched in the manual and a couple of sites not finding what I
am looking for.
When I use this command
echo mysql_result($result,$i,received_date);
the result is 2000-04-27, and what I want it to look like is 04-27-00.
I had a couple of suggestions that didn't work, we are reading this from
mysql just in case that's a factor.
Thanks