sfc Posted July 16, 2010 Share Posted July 16, 2010 Warning: require_once() [function.require-once]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /home/cernem5/public_html/includes/form_functions.php on line 2 I looked through all of the php.ini file and I can find this setting. Any suggestions? I contacted the guys at inmotion who are hosting my vps and they said they had to make a change on their server since I didn't have root access. Is there a way in my coding to avoid this problem? Here is the code that is causing all the problems: <?php echo date("Y", time()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/207950-timezone-setting/ Share on other sites More sharing options...
bh Posted July 16, 2010 Share Posted July 16, 2010 Hi, in PHP: http://php.net/manual/en/function.date-default-timezone-set.php in php.ini: date/Default timezone Quote Link to comment https://forums.phpfreaks.com/topic/207950-timezone-setting/#findComment-1087089 Share on other sites More sharing options...
sfc Posted July 16, 2010 Author Share Posted July 16, 2010 I don't understand how to use this function with my code. Do I put it in an include file for each page? Quote Link to comment https://forums.phpfreaks.com/topic/207950-timezone-setting/#findComment-1087094 Share on other sites More sharing options...
bh Posted July 16, 2010 Share Posted July 16, 2010 Put it in your first script which always runs. Quote Link to comment https://forums.phpfreaks.com/topic/207950-timezone-setting/#findComment-1087098 Share on other sites More sharing options...
PFMaBiSmAd Posted July 16, 2010 Share Posted July 16, 2010 You can always add a line to your php.ini to set date.timezone = 'your value' You can also set date.timezone in a .htaccess if php is running as an Apache Module or in a local php.ini when php is running as a CGI application. Quote Link to comment https://forums.phpfreaks.com/topic/207950-timezone-setting/#findComment-1087100 Share on other sites More sharing options...
sfc Posted July 16, 2010 Author Share Posted July 16, 2010 That's what I did. I put it in the ini file. This is my first time running on a remote server so I'm not familiar with this.... Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/207950-timezone-setting/#findComment-1087103 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.