Time zone errors displaying on web pages
Posted by Wolf on 26 August 2011 07:30 AM
Due to recent upgrades to php versions, your web application may begin showing a time zone warning. |
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.
Fortunately there are several easy ways to correct this situation.
1. you can modify your php scripts to set the timezone - plenty of examples exist with a simple search
2. In your htaccess file for your website you can set the timezone as follows: php_value date.timezone 'America/Denver'
Other timezones can be used, we just provide ours as an example.
3. It can be changed in php.ini but then that becomes a server wide setting and in a shared hosting environment it is not logical to conclude that all sites want to be in our time zone.