If you’ve just upgraded to PHP 5.3, your scripts will probably generate a bunch of timezone errors.

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 […]

This article was posted by Independent Software, a website and database application development company based in Maputo, Mozambique. Our website offers regular write-ups on technical and design issues, ranging from details at code level to 3D Studio Max rendering. Read more about Independent Software's philosophy, or get in touch with Independent Software.

If you’ve just upgraded to PHP 5.3, your scripts will probably generate a bunch of timezone errors.

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:

Now the warnings will be gone.

Leave a Reply

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