#2880 date.timezone error


Environment: PhpGedView Version 4.2.4, PHP Version 5.3.5, Apache under Windows

Problem: getting "Warning: 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."

Cause: (official explanation at http://php.net/manual/en/function.date-default-timezone-set.php\) Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn't valid, and/or a E_WARNING message if using the system settings or the TZ environment variable.

1. modifying php.ini file by finding the line “date.timezone =”, uncomment it, and set the value like
date.timezone = “Europe/Istanbul”;
2. modifying config.php file by adding a line like
Since the first solution needs admin privilages for the server, the second way is more convenient.

There should be a variable for timezone in config.php which is set to a default value if no local value is found. This value should also from admin.php


  • Gerry Kroll

    Gerry Kroll - 2011-10-03

    This is not a PhpGedView bug, and has been discussed many times.

    When the problem is applicable not only to PhpGedView but to other PHP scripts as well, the solution MUST be implemented outside the PhpGedView program. It's not reasonable to fix each PHP program individually.

    The correct solution is to apply the change to the php.ini file. This is also what other "authorities" recommend.

    This is one of many "improvements" forced upon us by the PHP developers. Unfortunately, there's little we can do about this, other than to follow the documented recommendations.

  • Gerry Kroll

    Gerry Kroll - 2011-10-03
    • assigned_to: nobody --> canajun2eh
    • status: open --> closed-rejected

Log in to post a comment.