I got this timestamp from the facebook feed. What I need is to convert iHow can I convert the following date & time and add another 1 hour to the result?
2014-05-28T06:47:05+01:00
to 28/05 08:47
?
Thank you
I got this timestamp from the facebook feed. What I need is to convert iHow can I convert the following date & time and add another 1 hour to the result?
2014-05-28T06:47:05+01:00
to 28/05 08:47
?
Thank you
// Convert to a DateTime object
$dateTime = new DateTime('2014-05-28T06:47:05+01:00');
$dateTime->setTimezone(new DateTimeZone('UTC'));
// Add an hour (as you requested)
$dateTime->add(new DateInterval('PT1H'));
// Display formatted date/time
echo $dateTime->format('Y-m-d H:i:s');
or your timezone of choice
You use strtotime
to convert the time to an integer, then use date
to convert it back to a string in the format you'd like.