Jump to content
TNG Community
Norma

Error log about time zones

Recommended Posts

Norma

I just discovered a bunch of error logs that are filling up with the following message:

[13-Mar-2019 02:45:54 UTC] PHP Warning:  date(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in  <mysite>/Tng12/admin_filepicker.php on line 216

I was not prompted for anything relating to a time zone when I installed TNG and my husband, who knows a fair bit about this stuff, has recommended that the following line be inserted into begin.php 

     date_default_timezone_set("America/Montreal");

Ideally, the America/Montreal would be replaced by a time-zone variable so user could set the time-zone during installation. 

Considering that the change to php requiring explicit time-zone setting was made years ago, I am very surprised that this was not fixed especially for this spanking new version. If there is something else I need to fix, I hope someone will let me know.

Norma

Share this post


Link to post
Share on other sites
theKiwi

That line should be set into the php.ini file for your site's host - TNG is expecting to find this information from the hosting site, not from within itself.

Putting that line into the start of begin.php will probably fix the issue for now, but each time TNG is updated and a new begin.php file is uploaded this "fix" will be lost.

You should contact whoever your hosting provider is about this.

Roger

Share this post


Link to post
Share on other sites
Norma

Thank you for the quick response. It has been pointed out to me that putting the line in the php.ini file when using shared hosting will affect all the other users who share the host. They may not be in the same time zone. It seems to be user or application specific.

I will have to leave it in the begin.php file for now in the absence of any other solution and remember to replace it if and when I upgrade.

Norma

Share this post


Link to post
Share on other sites
Ken Roy

Your hosting service should be able to tell you how / where you can override the php.ini for your account.  

Share this post


Link to post
Share on other sites
theKiwi
7 hours ago, Norma said:

Thank you for the quick response. It has been pointed out to me that putting the line in the php.ini file when using shared hosting will affect all the other users who share the host. They may not be in the same time zone. It seems to be user or application specific.

No, the host can set the php.ini for each user on a shared server.

Roger

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×