To be honest, I didn't know I could format the date within my query. For some reason, I was under the assumption that since dates go into MySQL in a specific format, that's how they came out.
Anyway, thanks for pointing this out to me! Very helpful. Jason Soza ----- Original Message ----- From: Jesper Brunholm <[EMAIL PROTECTED]> Date: Friday, June 21, 2002 2:02 am Subject: Re: [PHP] Stumped on a function > 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: > <" > target="l">http://www.mysql.com/doc/D/a/Date_and_time_functions.html> - look > somewhat below the middle of the page > > >>function cleandate($indate) { > >> str_replace("-", "/", $indate); > >> return date("F j, Y", strtotime($indate)); > >> } > > check the $indate - response from the db - if you give invalid > data > there then it will (probably) use a timestamp instead, whith now()- > values... > >> when I echo $newdate using the above code, I get "June 20, > 2002" - > >> today's date. > > Regards > > Jesper Brunholm > > -- > Phønix - Danish folk music from young musicians - > http://www.phonixfolk.dk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php