Index: moodlelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/moodlelib.php,v
retrieving revision 1.960.2.68
diff -u -r1.960.2.68 moodlelib.php
--- moodlelib.php	25 Mar 2008 09:35:56 -0000	1.960.2.68
+++ moodlelib.php	29 Mar 2008 03:47:43 -0000
@@ -1068,6 +1068,11 @@
  */
 function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0, $timezone=99, $applydst=true) {
 
+    $strtimezone = NULL;
+    if (!is_numeric($timezone)) {
+        $strtimezone = $timezone;
+    }
+
     $timezone = get_user_timezone_offset($timezone);
 
     if (abs($timezone) > 13) {
@@ -1076,7 +1081,7 @@
         $time = gmmktime((int)$hour, (int)$minute, (int)$second, (int)$month, (int)$day, (int)$year);
         $time = usertime($time, $timezone);
         if($applydst) {
-            $time -= dst_offset_on($time);
+            $time -= dst_offset_on($time, $strtimezone);
         }
     }
 
@@ -1172,6 +1177,11 @@
 
     global $CFG;
 
+    $strtimezone = NULL;
+    if (!is_numeric($timezone)) {
+        $strtimezone = $timezone;
+    }
+
     if (empty($format)) {
         $format = get_string('strftimedaydatetime');
     }
@@ -1183,7 +1193,7 @@
         $fixday = ($formatnoday != $format);
     }
 
-    $date += dst_offset_on($date);
+    $date += dst_offset_on($date, $strtimezone);
 
     $timezone = get_user_timezone_offset($timezone);
 
@@ -1293,7 +1303,6 @@
  */
 function usergetmidnight($date, $timezone=99) {
 
-    $timezone = get_user_timezone_offset($timezone);
     $userdate = usergetdate($date, $timezone);
 
     // Time of midnight of this user's day, in GMT
@@ -1407,7 +1416,7 @@
 
     $tz = 99;
 
-    while(($tz == '' || $tz == 99) && $next = each($timezones)) {
+    while(($tz == '' || $tz == 99 || $tz == NULL) && $next = each($timezones)) {
         $tz = $next['value'];
     }
 
@@ -1450,11 +1459,7 @@
 function calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL) {
     global $CFG, $SESSION;
 
-    if ($strtimezone == NULL) {
-        $usertz = get_user_timezone();
-    } else {
-        $usertz = $strtimezone;
-    }
+    $usertz = get_user_timezone($strtimezone);
 
     if (is_float($usertz)) {
         // Trivial timezone, no DST
