Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-1152

MRBS prior to version 1.4.x mishandles timezones in some environments when displaying bookings made before change to daylight saving time when in daylight saving time. These booking times show as an hour early.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Block: Mrbs
    • Labels:
      None
    • Environment:
      PHP5 & MySQL running on Linux servers.
    • Database:
      MySQL
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Any bookings made prior to change to DST will have to be fixed using SQL. In tests, the following code (taken from version 1.4.1) fixes the problem for future time changes:

      in web/config.inc.php the following needs to be added:

          • snip --*

      // The timezone your meeting rooms run in. It is especially important
      // to set this if you're using PHP 5 on Linux. In this configuration
      // if you don't, meetings in a different DST than you are currently
      // in are offset by the DST offset incorrectly.
      //
      $timezone = "Europe/London";

          • snip --*

      If your server timezone is not that above, you will need to edit that line. q.v. http://uk3.php.net/timezones for those available.

      in web/functions.inc the following needs to be added near the top of the file:

          • snip --*

      /////////////////////////////////////////
      // Set timezone, if one has been provided

      global $timezone;

      if (isset($timezone))
      {
      if (function_exists("date_default_timezone_set"))
      {
      date_default_timezone_set($timezone);
      }
      else
      {
      putenv("TZ=$timezone");
      }
      }

          • snip --*

      I've tested the above by changing server dates on an Ubuntu server and making bookings before and after this year's DST period and everything behaves properly now.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              davosmith Davo Smith
              Reporter:
              gizbun David Davies
              Participants:
              Component watchers:
              Davo Smith
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: