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

Activity start date and due date adds/subtracts 1 hr on backup and restore over DST -> Standard Time change

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Peer review in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.5, 3.6.5, 3.7, 3.8
    • Fix Version/s: 3.8
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      Hide

      Using the attached course backup:

      Test restore on DST course start date

      1. Restore the course on course start date March 23, 2020 (DST)
      2. Notice that when DST ends (on  5 April 2020, 3:00:00 am), the activity startdate and deadline should be the same as the original (deadline still set to 11 PM)

      Test restore on Standard time course start date

      1. Restore the course on course start date Sept 30, 2019 (Standard time)
      2. Notice that when DST starts (on 6 October 2019, 2:00:00 am), the activity startdate and deadline should be the same as the original (deadline still set to 11 PM)
      Show
      Using the attached course backup: Test restore on DST course start date Restore the course on course start date March 23, 2020 (DST) Notice that when DST ends (on  5 April 2020, 3:00:00 am), the activity startdate and deadline should be the same as the original (deadline still set to 11 PM) Test restore on Standard time course start date Restore the course on course start date Sept 30, 2019 (Standard time) Notice that when DST starts (on 6 October 2019, 2:00:00 am), the activity startdate and deadline should be the same as the original (deadline still set to 11 PM)
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:

      Description

      Activity start dates and due dates are being shifted by (+/-)1 hour during backup and restore.

      This happens when we have an overlap of DST and Standard time. Moodle calculates the date offset by subtracting the original course start date to the new course start date on restore.

      For example:

      Original course start date:  July 15, 2019 12 AM (AEST) = 1563112800

      Setting (The new course start date): September 30, 2019 12 AM (AEST) = 1569765600

      Offset = Setting - Original

      Offset = 6652800

      So if we have an assignment start date:

      Assignment (original start date): July 16, 12 AM (AEST)= 1563199200

      the new assignment start date on restore will be:

      July 16, 12 AM (1563199200) + Offset(6652800) = Oct 1, 12 AM (1569852000)

      Assignment (original due date):  July 23, 11 PM (AEST) =  1563886800

      the new assignment due date on restore will be:

      July 23, 11 PM (1563886800) + Offset(6652800) = Oct 9, 12 AM (1570539600)

      Notice that the time changed from 11 PM to 12 AM because Daylight saving time started on October 6, 2019 2 AM (AEDT).

       

      Please see the attached PDF for more examples 

       

      Steps to replicate:

      Replicate subtracting 1 hour on startdate and/or duedate:

      1. Use the attached course backup
      2. Restore the course on course start date March 23, 2020 (DST)
      3. Notice that when DST ends (on  5 April 2020, 3:00:00 am), the activity deadline is changed from 11 PM to 10 PM

      Replicate adding 1 hour on startdate and/or duedate:

      1. Use the attached course backup 
      2. Restore the course on course start date Sept 30, 2019 (Standard time)
      3. Notice that when DST starts (on 6 October 2019, 2:00:00 am), the activity startdate changed from 12 AM to 1AM and the deadline changed from 11 PM to 12 AM

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                trishamilan Trisha Milan
                Reporter:
                trishamilan Trisha Milan
                Peer reviewer:
                Brendan Heywood
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Fix Release Date:
                  11/Nov/19