I have tried this code:
$dateFromDB = '2012-06-22T14:06:55+00:00';
$newDate = DateTime::createFromFormat('yyyy-MM-ddThh:mm:sszzz', $dateFromDB);
$date = $newDate->format('U'); // convert to timestamp
echo $date;
but gave me this error:
Fatal error: Call to a member function format() on a non-object in...
What is the problem with this code?