Wednesday, January 20, 2010

You are *required* to use the date.timezone setting or the date_default_timezone_set() function.

warning: strtotime(): 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 in /var/www/html/drupal-6.15/modules/node/node.module on line 802.
If you get an error something like this. Do not worry. Just edit your /etc/php.ini file (the location of yours may differ) and add an entry for the date.timezone that should look something like this:
date.timezone = "America/New_York"
Then restart your webserver:
service httpd restart
Of course, your commands for restarting your webserver may be different depending on your lifestyle. But, no more errors from php functions trying to figure out what time it is.

Hope that helps.

5 comments:

  1. I found your hint and tried some things...I work on openSUSE and had to edit the file /etc/php5/apache2/php.ini and inserted the line: date.timezone = "Europe/Berlin";

    Thanks for that. I almost went insane.

    Regards

    ReplyDelete
  2. Thanks mate -- cleared it right up!

    ReplyDelete
  3. Thanks a lot for such a nice solution.

    ReplyDelete
  4. Thanks! Yeshua Ha Moshiach!!

    ReplyDelete