From fefe0305fd3684bb5824f99a67dac44512bf92b8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 18 Apr 2003 08:37:04 +0000 Subject: [PATCH] fix for bug reported on user-list, time-compare creates date before 1970/1/1 which is the earliest allowed date on windows --- phpgwapi/inc/class.datetime.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.datetime.inc.php b/phpgwapi/inc/class.datetime.inc.php index f7744e0907..e64e38e31e 100755 --- a/phpgwapi/inc/class.datetime.inc.php +++ b/phpgwapi/inc/class.datetime.inc.php @@ -454,8 +454,10 @@ function time_compare($a_hour,$a_minute,$a_second,$b_hour,$b_minute,$b_second) { - $a_time = mktime(intval($a_hour),intval($a_minute),intval($a_second),0,0,70); - $b_time = mktime(intval($b_hour),intval($b_minute),intval($b_second),0,0,70); + // I use the 1970/1/2 to compare the times, as the 1. can get via TZ-offest still + // before 1970/1/1, which is the earliest date allowed on windows + $a_time = mktime(intval($a_hour),intval($a_minute),intval($a_second),1,2,1970); + $b_time = mktime(intval($b_hour),intval($b_minute),intval($b_second),1,2,1970); if($a_time == $b_time) { return 0;