Moodle

After switch from daylight savings to standard time, course>partcipants>activity reports>all logs: graph of hits on course by user shows two Sundays and log entries are shown under wrong day.

Details

  • Type: Sub-task Sub-task
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.6.5, 1.8.3, 1.9
  • Fix Version/s: None
  • Component/s: Administration, Other
  • Labels:
    None
  • Affected Branches:
    MOODLE_16_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

After switch from daylight savings to standard time (in US, Sunday, 2007-11-04), course>partcipants>activity reports>all logs: graph of hits on course by user shows two Sundays and log entries are shown under wrong day.
See discussion here for images: http://moodle.org/mod/forum/discuss.php?d=83392
Note, to reproduce make sure the course start date in which you test is close to the current date to make sure you can see individual days but before the time change so you can see the double days.

This has effected Moodle sites:
Moodle versions 1.6.5,1.8.3+(2007-11-01),1.9+(2007-11-01),
OS Solaris 10 and Linux.

Issue Links

Activity

Hide
Michael Spall added a comment -

If you switch the setting Administration>Location>Location settings>Default timezone(timezone) from "Server's local time" to any other setting the graph appears correctly.

Show
Michael Spall added a comment - If you switch the setting Administration>Location>Location settings>Default timezone(timezone) from "Server's local time" to any other setting the graph appears correctly.
Hide
Michael Spall added a comment -

Correction:
If you switch the setting Administration>Location>Location settings>Default timezone(timezone) from "Server's local time" or a setting that uses daylight savings time to a setting that doesn't use daylight savings time, e.g, MST or -7 the graph appears correctly.

Show
Michael Spall added a comment - Correction: If you switch the setting Administration>Location>Location settings>Default timezone(timezone) from "Server's local time" or a setting that uses daylight savings time to a setting that doesn't use daylight savings time, e.g, MST or -7 the graph appears correctly.
Hide
Joseph Rézeau added a comment -

Michael,

Your suggested workaroung may indeed solve the current problem, but then it means that the "country timezones" time system is no longer available on the moodle site.

I think another, long-term solution should be found, which would allow the use of a country timezone which has a daylight savings time system (such as most European countries) AND does not mess up dates in the logs graph...
Joseph

Show
Joseph Rézeau added a comment - Michael, Your suggested workaroung may indeed solve the current problem, but then it means that the "country timezones" time system is no longer available on the moodle site. I think another, long-term solution should be found, which would allow the use of a country timezone which has a daylight savings time system (such as most European countries) AND does not mess up dates in the logs graph... Joseph
Hide
Michael Spall added a comment -

It also has the problem of showing incorrect times for historical data during the daylight savings periods.

Show
Michael Spall added a comment - It also has the problem of showing incorrect times for historical data during the daylight savings periods.
Hide
Martin Dougiamas added a comment -

Is this a regression? I'm almost certain this used to work correctly ...

Show
Martin Dougiamas added a comment - Is this a regression? I'm almost certain this used to work correctly ...
Hide
Petr Škoda (skodak) added a comment -

I doubt it is a regression, I think it depends on version of PHP and combination of timezone/DST.

Show
Petr Škoda (skodak) added a comment - I doubt it is a regression, I think it depends on version of PHP and combination of timezone/DST.
Hide
Michael Spall added a comment -

The PHP versions for our Moodle sites were 5.2.0 and 5.2.4 at the time the issue was filed. The sites with PHP 5.2.4 were updated to PHP 5.2.5 and the issue was still present.

I have wondered whether the issue is incorrect values in mdl_timezone, specifically in the dst_time and std_time fields.

Show
Michael Spall added a comment - The PHP versions for our Moodle sites were 5.2.0 and 5.2.4 at the time the issue was filed. The sites with PHP 5.2.4 were updated to PHP 5.2.5 and the issue was still present. I have wondered whether the issue is incorrect values in mdl_timezone, specifically in the dst_time and std_time fields.
Hide
Jonathan Champ added a comment -

I have attached a patch for Moodle 1.9.11 that correctly calculates the days to show in the drop downs. This resolves the wrong date and wrong log entry date range issues for the activity log. The issue is due to the incorrect assumption that there are 86400 seconds in a day when you are using the user's timezone.

Show
Jonathan Champ added a comment - I have attached a patch for Moodle 1.9.11 that correctly calculates the days to show in the drop downs. This resolves the wrong date and wrong log entry date range issues for the activity log. The issue is due to the incorrect assumption that there are 86400 seconds in a day when you are using the user's timezone.

Dates

  • Created:
    Updated: