Page 1 of 1

PHP error:not safe to rely on the system's timezone settings

Posted: Wed Apr 14, 2010 5:41 pm
by jgab
Hi, I just install HESK 2.1 on our site, the script is working fine, but it is generating this error on our php error log:

[14-Apr-2010 12:28:11] PHP Strict Standards: strtotime() [0function.strtotime0]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '(my continent)/(my city)' for 'CLT/-4.0/no DST' instead in xxx/xxx/xxx/inc/common.inc.php on line 357
[14-Apr-2010 12:28:11] PHP Strict Standards: date() [0function.date0]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 '(my continent)/(my city)' for 'CLT/-4.0/no DST' instead in xxx/xxx/xxx/inc/common.inc.php on line 370

What can I do to resolve this? thank you.

Posted: Thu Apr 15, 2010 4:41 pm
by Klemen
Your PHP installation doesn't have a default timezine set and it's reporting the error beacuse you have PHP running in strict mode.

You should set the default date to one of the supported timezones listed here:
http://www.php.net/manual/en/timezones.php

In your case probably "America/Santiago"?

If you have access to php.ini find date.timezone and set it to
date.timezone = America/Santiago

Then restart the server (Apache).

- OR -

You can try adding this to the top of common.inc.php file (below the copyright text):

Code: Select all

date_default_timezone_set('America/Santiago');