MySql DATE to formatted display

I would like to take the MySQL DATE value of ‘20130818’ and turn it into a string like ‘Sunday Aug 18, 2013’.

Could anyone suggest the best method?

[php]echo date(“l M j, Y”, $mysql_date_from_db); //$mysql_date_from_db being the string from your db.[/php]

Thanks fastsol,

Now here is a bit of an odd question.

I am currently using this script to bring date data from the user to the database, however I would like to give them the option to leave it blank for editing later. Is there another simpler way to get dates from users with an option to leave blank?

Thanks in advance!

PS: I don’t like the link restrictions… “This script” should have linked to http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm

Depending how you do your validation you could just set the date var to empty if not date data was sent through and just update the db with the empty data.

Sponsor our Newsletter | Privacy Policy | Terms of Service