Index: course/report/log/lib.php
===================================================================
--- course/report/log/lib.php	(revision 21)
+++ course/report/log/lib.php	(working copy)
@@ -199,17 +199,22 @@
     $timemidnight = $today = usergetmidnight($timenow);
 
     // Put today up the top of the list
-    $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) );
+    $dates = array("$timemidnight" => get_string("today").", ".userdate($timemidnight, $strftimedate) );
 
     if (!$course->startdate or ($course->startdate > $timenow)) {
         $course->startdate = $course->timecreated;
     }
 
     $numdates = 1;
+    $old_offset = dst_offset_on($timemidnight);
     while ($timemidnight > $course->startdate and $numdates < 365) {
-        $timemidnight = $timemidnight - 86400;
-        $timenow = $timenow - 86400;
-        $dates["$timemidnight"] = userdate($timenow, $strftimedaydate);
+        $timemidnight -= 86400;
+        $new_offset = dst_offset_on($timemidnight);
+        if ($old_offset != $new_offset) {
+            $timemidnight += $old_offset - $new_offset;
+            $old_offset = $new_offset;
+        }
+        $dates["$timemidnight"] = userdate($timemidnight, $strftimedaydate);
         $numdates++;
     }
 
@@ -414,17 +419,22 @@
     $timemidnight = $today = usergetmidnight($timenow);
 
     // Put today up the top of the list
-    $dates = array("$timemidnight" => get_string("today").", ".userdate($timenow, $strftimedate) );
+    $dates = array("$timemidnight" => get_string("today").", ".userdate($timemidnight, $strftimedate) );
 
     if (!$course->startdate or ($course->startdate > $timenow)) {
         $course->startdate = $course->timecreated;
     }
 
     $numdates = 1;
+    $old_offset = dst_offset_on($timemidnight);
     while ($timemidnight > $course->startdate and $numdates < 365) {
-        $timemidnight = $timemidnight - 86400;
-        $timenow = $timenow - 86400;
-        $dates["$timemidnight"] = userdate($timenow, $strftimedaydate);
+        $timemidnight -= 86400;
+        $new_offset = dst_offset_on($timemidnight);
+        if ($old_offset != $new_offset) {
+            $timemidnight += $old_offset - $new_offset;
+            $old_offset = $new_offset;
+        }
+        $dates["$timemidnight"] = userdate($timemidnight, $strftimedaydate);
         $numdates++;
     }
 
