Re: Date Conversions?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 15 Nov 2004 14:29:59 -0500, Robert Sossomon
<robert_sossomon@xxxxxxxx> wrote:
> 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?

In PHP you can take it apart and put it back together.

$date = explode('-', $array['date']);

If it's an actual date or time field in MySQL, you can use
date_format() to reformat it in the query and skip the PHP.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux