Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-14093

DST not applied properly when requesting explicit timezones

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.4, 1.9
    • Fix Version/s: 1.8.5, 1.9.1
    • Component/s: General, Libraries
    • Labels:
      None
    • Environment:
      Any, with timezones loaded...
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Some days ago, with MDL-13959 , we fixed the usergetdate() to work properly with timezones passed as parameters, because DSTs weren't being properly calculated then. The solution was about to "save" the parameter value and then pass it straight to the dst_offset_on() function. Else, the original parameter became transformed and DST weren't applied.

      The same behaviour can be extended to other moodlelib functions:

      make_timestamp()
      userdate()
      usergetmidnight()

      All them can accept one timezone parameter and, if used, DST aren't properly applied.

      IMPORTANT NOTE: This doesn't affect normal Moodle operations, where the DST to be applied is calculated by looking server and user timezones. This ONLY affects it we want to know the time in another timezone (imagine one block showing different times or something like that).

      So those functions should be patched with a similar solution that the one used for usergetdate() in MDL-13959.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stronk7 Eloy Lafuente (stronk7)
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Tester:
                Mathieu Petit-Clair
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Apr/08