DATE_FORMAT
Posted: Mon Jul 05, 2004 5:15 am
I have a table that that contains lots of dates.
Normallly to format a date when pulling it from MySQL, i would do the following
...but, in this instance there are about 10 dates to format at once, and producing a query with 10 DATE_FORMAT functions seems a bit excessive.
Is there another way to do it within the query, or would it be better creating a PHP function to format the date after it has been pulled from the DB?
Cheerz
Mark
Normallly to format a date when pulling it from MySQL, i would do the following
Code: Select all
SELECT *, DATE_FORMAT(pi_date, '%d-%m-%Y') AS display_date......Is there another way to do it within the query, or would it be better creating a PHP function to format the date after it has been pulled from the DB?
Cheerz
Mark