Code first
echo time() . \'
\';
echo date(\'Y-m-d H:i:s\') . \'
\';
date_default_timezone_set(\'America/New_York\');
echo time() .
Had the same issue myself, and this is the easiest approach I could do fairly quickly.
$dateTimeZone = new DateTimeZone("America/New_York");
$dateTime = new DateTime("now", $dateTimeZone);
$timeOffset = $dateTimeZone->getOffset($dateTime);
// New time since epoch according to timezone
$newTime = time() + $timeOffset;
echo date("H:i:s", $newTime);