ginerjm Posted May 19, 2016 Share Posted May 19, 2016 After moving to a dedicated server with my hoster, I have suddenly run across a time zone issue. Seems that the .ini file shows me as UTC, instead of 'America/New York'. Since I dont' have access the the master php.ini file I do have a set of little override files in all of my folders that up until this move worked just fine for me. Now however it appears that these little override files aren't being read. Is there some setting that my host needs to alter? Second part of this question. Why doesn't this line work: ini_set('date.timezone','America/New York'); It doesn't like the line saying: Warning: ini_set(): Invalid date.timezone value 'America/New York', we selected the timezone 'UTC' for now. in /home/albany/public_html/homejg/jg/check_ini_file.php on line 6 Is there some other syntax to use in ini_set? PS - I'm running PHP 5.5.31 Quote Link to comment Share on other sites More sharing options...
benanamen Posted May 19, 2016 Share Posted May 19, 2016 (edited) date_default_timezone_set('America/New York'); http://php.net/manual/en/function.date-default-timezone-set.php The line you reference is for use in the actual php.ini. that you say you do not have access to. Per the manual re: date.timezone: The behaviour of these functions is affected by settings in php.ini. http://php.net/manual/en/datetime.configuration.php#ini.date.timezone I dont' have access the the master php.ini file You're on a dedicated server but you don't have root access? Edited May 19, 2016 by benanamen Quote Link to comment Share on other sites More sharing options...
kicken Posted May 19, 2016 Share Posted May 19, 2016 it's America/New_York, with an underscore not a space. Quote Link to comment Share on other sites More sharing options...
benanamen Posted May 19, 2016 Share Posted May 19, 2016 Good catch @kicken! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.