Forum Moderators: coopster
I have my dates stored in my MySQL DB with an expiration associated with it. These are stored in Y-m-d format (Yahoo default (I beleive MySQL as well))
How do I convert these dates to display as a a "regular date"?
I have tried to name my variable in the way I want, but I simply destroy the integrity of the file by doing so.
Thanks!
$query = "SELECT DATE_FORMAT(date_col,'%m/%d/%Y') AS date_name";
// selects in the format:
Look up more about the DATE_FORMAT function here: Date and Time Functions [dev.mysql.com]
Good luck :)
$query = "SELECT DATE_FORMAT(date_col,'%m/%d/%Y') AS date_name FROM table_name";
..although I think you got the point before :)
Sorry about that!
echo date('F j, Y', strtotime($getdate));
PHP date reference [php.net]