I got this error when I requested to update the PHP version from 5.2.17 to PHP 5.3.21 on the server.
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: 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 'America/New_York' for 'EDT/-4.0/DST' instead</p>
<p>Filename: libraries/Log.php</p>
<p>Line Number: 86</p>
</div>
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 'America/New_York' for 'EDT/-4.0/DST' instead in /filelocation right here/system/libraries/Log.php on line 86
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 'America/New_York' for 'EDT/-4.0/DST' instead in /filelocation right here/system/libraries/Log.php on line 99
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: 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 'America/New_York' for 'EDT/-4.0/DST' instead</p>
<p>Filename: libraries/Log.php</p>
<p>Line Number: 99</p>
</div>
If you cannot modify your php.ini configuration, you could as well use the following snippet at the beginning of your code:
The list of timezones can be found at http://www.php.net/manual/en/timezones.php.
instead of
worked for me (shows current year and no more shows the error message). (Thanks to Chris above)
If you are using CodeIgniter and can't change php.ini, I added the following to the beginning of index.php:
I had to put it in double quotes.
You can set the timezone in your
.htaccess
fileThis issue has been bugging me for SOME time as im trying to inject a "createbucket.php" script into composer and i keep being told my time-zone is incorrect.
In the end the only thing that fixed the issue was to:
$ sudo nano /etc/php.ini
Search for timezone
Ensure you remove the
;
Then finally
And you'll be good to go :)