I want to have the ability to set the timezone based off of a variable. I have the following:
$timezone_set = 'America/New_York';
date_default_timezone_set($timezone_set);
ini_set("date.timezone", $timezone_set);
echo(date_default_timezone_get());
echo($timezone_set);
This outputs:
UTC
America/New_York
However, if I use:
$timezone_set = 'America/New_York';
date_default_timezone_set("America/New_York");
ini_set("date.timezone", "America/New_York");
echo(date_default_timezone_get());
echo($timezone_set);
I get:
America/New_York
America/New_York
Can someone explain a) if what I'm trying to do is possible b) if so, how?