Index: lib.php
===================================================================
--- lib.php	(.../b1-9-2/course)	(revision 6695)
+++ lib.php	(.../devel19/general/bug866/course)	(revision 6697)
@@ -647,7 +647,17 @@
 
         $myxls->write($row, 0, $courses[$log->course], '');
         // Excel counts from 1/1/1900
-        $excelTime=25569+$log->time/(3600*24);
+        //AUCHANGE
+        /* 
+          The time needs to be calculated from GMT time, not local time. If we include the timezone it mixes Excel up.
+          Excel times count from 1/1/1900 based on local computer time, so the timezone adjustment is inherently present.
+        */
+        $timeparts = usergetdate($log->time);
+        $adjustedtime = strtotime("{$timeparts['year']}-{$timeparts['mon']}-{$timeparts['mday']} {$timeparts['hours']}:{$timeparts['minutes']}:{$timeparts['seconds']} GMT");
+        
+        $excelTime=25569+($adjustedtime/(3600*24));
+        //AUEND
+        
         $myxls->write($row, 1, $excelTime, $formatDate);
         $myxls->write($row, 2, $log->ip, '');
         $fullname = fullname($log, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
