PHP – It is not safe to rely on the system’s timezone settings.

Edit php.ini, mine, on CentOS 7 is located at /etc/php.ini.
Lets add the following line.

date.timezone = America/New_York

For other timezone take a look at http://www.php.net/manual/en/timezones.php

and then restart httpd

service httpd restart

If you don’t have access to the php.ini, here is another way to do it.
On our app/php…

if(!ini_get('date.timezone'))
{
    date_default_timezone_set('GMT');
}

as seen on http://stackoverflow.com/questions/16765158/date-it-is-not-safe-to-rely-on-the-systems-timezone-settings

😉

Leave a Reply

Your email address will not be published. Required fields are marked *

*