Re: Stumped on a function
| From: | Jesper Brunholm | Date: | Fri, 21 Jun 2002 10:02:55 +0000 |
| Subject: | Re: Stumped on a function | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103249@lists.php.net to get a copy of this message | ||
John Holmes wrote:
Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all??you might want a link to that: <http://www.mysql.com/doc/D/a/Date_and_time_functions.html> - look somewhat below the middle of the page
check the $indate - response from the db - if you give invalid data there then it will (probably) use a timestamp instead, whith now()-values...function cleandate($indate) { str_replace("-", "/", $indate); return date("F j, Y", strtotime($indate)); }
Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dkwhen I echo $newdate using the above code, I get "June 20, 2002" - today's date.