-
Type: Bug Report
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.0.3
-
Fix Version/s: 5.1.0-B1
-
Component/s: Data Management
-
Labels:
-
External issue URL:
-
External issue ID:743
-
Copy Issue Key:
-
Patch Instructions:
In most cases web-server 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:
date_default_timezone_set('Europe/Moscow');
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.
Also code putenv('TZ=Europe/Moscow'); will work for PHP4.