php date format

Hello, I am new on php and I have a date like this 2-03-2011 on my table in mysql and would like to format this date to show march Wednesday, March 2, 2011 when I echo it out, and will will apply to all the rows in that table if i will have to loop them to get all the date values based on an id. Please I need someone to help me on the php script to use achieve this.

you can do it using php or at runtime using mysql:

DATE_FORMAT(date, ‘%l:%i %p, %W %e %M %Y’) AS date // will output 12:35pm Saturday 1 July 2000

echo date(‘g:ia l j F Y’, $row[‘date’]); // will output 12:35pm Saturday 1 July 2000[/php]

Hope this helps

Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service