Page 2 of 2

Posted: Fri Jan 27, 2006 10:11 am
by feyd
wtf wrote:
I have a date stored in a database in this format ("m-d-Y"). I want to print out the date in a table but only showing the month and day ex: ("m-d").

Code: Select all

...DATE_FORMAT(date_assigned, '%m-%d') AS date_assigned...
will format date as you want it. It's already a part of your sql statement, therefore $row['date_assigned'] will come out in the format you want.
FYI, m-d-Y is not a MySQL date format, so the field is not a DATE type.

Thank You

Posted: Fri Jan 27, 2006 6:19 pm
by icesolid
Thank you feyd for explaining! :D