In most cases webserver is physically located in same timezone as website, that is hosted on it. However there are some cases, when they differ.
To overcome that we have 2 settings in configuration:
- timezone of server
- timezone of website
When they differ we add difference before date is displayed and remove difference before date is saved to database. This method however doesn't process case when daylight saving settings differ from website to server.
Since there was no other way to do that in PHP4 it's developed as is.
PHP5 offers more control over daylight saving settings via date_default_timezone_set
function, that allows to set both website timezone and daylight saving settings in one call like this:
We just need to set it during script initialization and no more need to trick timestamps before saving/displaying them.
At the end we will have list of supported timezones (see http://lv.php.net/manual/en/timezones.php
) instead of 2 current configuration variables.