I’m trying to convert a variable named $releasedate which contains the string 'May 31, 2011' to the string '2011-05-31 00:00:00' to insert into the database.
I have tried…
$pubdate = date('Y-m-d H:i:s',$releasedate);
…but it didn’t work.
How do I do this?
You can use
strtotime().CodePad.