* Robert Sossomon <[EMAIL PROTECTED]>:
> I have a date in format YY-MM-DD in a MySQL table.  I need to pull it back to 
> display it in either format: MM-DD-YY or Month Day, Year format.
>
> I can't figure out how to write the query to do it, and am not sure
> how to make PHP just parse the one given and dump it back out in the
> way I need it.  Any suggestions?

http://php.net/strtotime

Specifically, try the following:

// $date is the date as pulled from the MySQL table
$convertedDate = date("m-d-y", strtotime($date));

-- 
Matthew Weier O'Phinney           | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to