PHP date.timezone warning

configurationPHPphp.initimezone

I keep getting this error:

Message: date() [function.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 'EST/-5.0/no DST' instead

I have edited my php.ini and added this to the end of it: date.timezone = "America/New_York"

After saving the php.ini and restarting Apache, I still get the error. I have also tried rebooting the entire server to no avail.

I'm running cPanel/WHM on CentOS 5.6 if that makes any difference. Also, the PHP handler is suphp.

I'm not sure what to try next… any guidance?

Best Answer

open the appropriate php.ini file and add the following, replacing the time zone with the one which is correct for you (list of timezone names - http://php.net/date.timezone):

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Chicago"

for a little more detail:

http://forums.modx.com/thread/33294/solved-warning-strtotime-function-strtotime-in-evo-1-01-on-php-5-3-0

Related Topic