"It is not safe to rely on the system's timezone settin |
|
OK. I figured out my error. Well, I don't know what caused it, but I just uncommented the following line:
Then restarted my webserver and it seems to work now. |
||||||||||||||
|
|
The E_WARNING is displayed if you use date/time function without setting the timezone (either in php.ini or in PHP script). I would suggest to set date/time setting on each PHP script using ini_set() function. This way you will be sure, that the timezone is correct everytime. Just put this simple line on the top of your main PHP file:
|
||||||||||||||
|
|
Thanks for the tip. Is there any advantage to doing this as opposed to setting the "date.timezone" field in php.ini?
|
||||||||||||
|
|
There is no difference on your local server. But you need to realize, that setting this in php.ini you are just configuring default settings for your local server. On the other hand setting this in PHP code, you are configuring server's environment on application's runtime. Realizing this, the advantage of setting it in PHP is that you set your own timezone on any server you deploy your application regardless the server's settings. Simply put, when you have this setting in PHP code, you do not need to care about server's configuration, which might be different or incorrect and your application will still run as you expect.
|
||||||||||||
|
|
Makes sense. Thanks for the tip!
|
||||||||||||
|
"It is not safe to rely on the system's timezone settin |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by