From: Robert Sossomon [mailto:[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?

I don't know how well PHP would handle the 2-digit year concept, so you
might be better off doing it in the query. Something like this:

SELECT DATE_FORMAT(date_field, '%m-%d-%y') AS date_format_1,
DATE_FORMAT(date_field, '%M %e, %y') AS date_format_2...

HTH!


-- 
Mike Johnson             Smarter Living, Inc.
Web Developer            www.smarterliving.com
[EMAIL PROTECTED]   (617) 886-5539

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

Reply via email to