I have a zip_code database that also has the correct time zone associated with the zip code. I store the users zip_code in a session and pull their time zone correctly like this:
$timezone_array = mysql_query("SELECT time_zone FROM zip_code WHERE zip_code = '".$zip_session."'");
while($timezone_cells = mysql_fetch_array($timezone_array))
{
$their_timezone = $timezone_cells['time_zone'];
}
if my zip code is 07110, then $their_timezone will be Eastern. How do I use this with PHP to set the correct timezone? I cant figure out a way to use this function date_default_timezone_set('America/new_york') like this date_default_timezone_set($their_timezone). the time_zones stored in the DB are Atlanic, Eastern, Central, Mountain, Pacific etc. Any function in PHP that can use these instead of nearest city ex: America/New_York?
US/Central, US/Eastern, US/Pacific are valid see:
List of Supported Timezones:Other