Is there a way to convert this:
Tue Aug 28 13:59:01 +0000 2012
Into a DateTime Object?
I need to diff the above value with a DateTime Object.
Is there a way to convert this:
Tue Aug 28 13:59:01 +0000 2012
Into a DateTime Object?
I need to diff the above value with a DateTime Object.
Just pass it into the DateTime constructor...
$date = new DateTime('Tue Aug 28 13:59:01 +0000 2012');
echo $date->format('Y-m-d H:i:s');
$date = new DateTime($yourDate);
this will covert to standard DateTime object
check php manual here . Example 2 will make it clear.