Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-590

Incorrect daylight time saving, when server timezone differs from site timezone

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: