Page 1 of 1

Changing Format

Posted: Fri Jun 23, 2006 12:33 am
by imatrox05
i have a simple query.

I am extracting data from a database and creating a report. The date in the database is stored in the format YYYY-MM-DD HH:MM:SS but when i display the report i just want the date to be displayed as MM/DD

Posted: Fri Jun 23, 2006 12:36 am
by feyd
MySQL has DATE_FORMAT()

Posted: Fri Jun 23, 2006 12:49 am
by imatrox05
Any PHP solution?

Posted: Fri Jun 23, 2006 12:54 am
by feyd
strtotime() or parse it yourself, possibly with some clever explode() calls.

Posted: Fri Jun 23, 2006 1:09 am
by RobertGonzalez
imatrox05 wrote:Any PHP solution?
It will cost less overhead to let the DB server format your date.

Posted: Fri Jun 23, 2006 1:15 am
by imatrox05
Oh Thank You