From 03c17ddfec6620a5e153dcca7c40199b7d1d0baf Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 13 Jan 2003 02:37:47 +0000 Subject: [PATCH] Fix for dates (the last?) --- lib/moodlelib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 61cc4b1f7e..5b7672d1ab 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -70,8 +70,12 @@ 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 - $time = gmmktime((int)$hour,(int)$minute,(int)$second,(int)$month,(int)$day,(int)$year); - return usertime($time, $timezone); // This is GMT + if ($timezone == 99) { + 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); + return usertime($time, $timezone); // This is GMT + } } function format_time($totalsecs, $str=NULL) { -- 2.39.5