PHP 5.3 and timezonesSat, 30 Jul 2011 If PHP 5.3 swamps you with warnings, then here's what to do about PHP's timezone compaints |
If you've just upgraded to PHP 5.3, your scripts will probably generate a bunch of errors in this vein: Warning: date(): It is not safe to rely on the system's timezone settings. You are Obviously, the solution is to use the date_default_timezone_set() function, but that means you need to change scripts that ran perfectly well and warning-free previously. There's another approach. You can set the default time zone in PHP's configuration file so that it won't bother you again (at least on your server). To do so, fine the date.timezone setting in php.ini and change it thusly: date.timezone = Africa/Maputo Now the warnings will be gone. |