]> git.mjollnir.org Git - moodle.git/commitdiff
Slightly more robust function
authormoodler <moodler>
Mon, 13 Jan 2003 02:42:57 +0000 (02:42 +0000)
committermoodler <moodler>
Mon, 13 Jan 2003 02:42:57 +0000 (02:42 +0000)
lib/moodlelib.php

index 5b7672d1ab023c0ec2947098ace5da1a21d1f41a..7d96ddd0b36fd6290d9646f3a31250d6667e0f73 100644 (file)
@@ -70,7 +70,13 @@ function set_config($name, $value) {
 function make_timestamp($year, $month=1, $day=1, $hour=0, $minute=0, $second=0, $timezone=99) {
 /// Given date parts in user time, produce a GMT timestamp
 
+    global $USER;
+
     if ($timezone == 99) {
+        $timezone = (float)$USER->timezone;
+    }
+
+    if (abs($timezone) > 13) {
         return mktime((int)$hour,(int)$minute,(int)$second,(int)$month,(int)$day,(int)$year);
     } else {
         $time = gmmktime((int)$hour,(int)$minute,(int)$second,(int)$month,(int)$day,(int)$year);