Format Date field in MySQL using PHP to displayed in table
Posted: Sun Mar 27, 2011 5:07 pm
Hello all,
I have a MYSQL table that has a column called "created" which is a Date type. I then have a simple PHP script that is trying to access this date and convert it into a more readable format.
Currently it outputs at 2011-03-28 but i want it to look like 28 Aug 2011
The php code i have tried is as follows
Although this returns 01 Jan 1970 which is the right format but it hasnt used the value from my database
Any help would be great !
Thanks David
I have a MYSQL table that has a column called "created" which is a Date type. I then have a simple PHP script that is trying to access this date and convert it into a more readable format.
Currently it outputs at 2011-03-28 but i want it to look like 28 Aug 2011
The php code i have tried is as follows
Code: Select all
$mysqldate = date( 'd M Y', $row['created'] );
echo $mysqldate;Any help would be great !
Thanks David