I get how to use strtotime
, but I first need to set a timezone, which is causing an issue:
$date = new DateTime();
$date->setTimezone(new DateTimeZone('America/New_York'));
$idate = $date->format('Y-m-d H:i:s');
$fdate=strtotime($idate,"+2 hours");
$idate
comes out fine, in the correct timezone, in this format: 2016-07-25 15:56:24
How can I add 2 hours onto this and return a variable in the same format?