From 5e4e027feab4c523aadb17c6ff3942c1f9a25d11 Mon Sep 17 00:00:00 2001 From: defacer Date: Sat, 12 Mar 2005 01:20:37 +0000 Subject: [PATCH] Pre-emptively put a lower bound of 1970 to years, instead of putting a lower bound of 0 to the generated timestamps. Windows' < 1970 bug won't have it otherwise. --- lib/olson.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/olson.php b/lib/olson.php index 979ff6338f3..d7eb2beb445 100644 --- a/lib/olson.php +++ b/lib/olson.php @@ -139,10 +139,10 @@ function olson_todst ($filename) { // start-of-year timestamp // TODO: perhaps should consider the current DST rule - $mdl_tz['from_timestamp'] = gmmktime(0, 0, 0, 1, 1, $mdl_tz['from'], 0) + $mdl_tz['gmtoff'] * 60 ; - if ($mdl_tz['from_timestamp'] < 0) { - $mdl_tz['from_timestamp'] = 0; + if($mdl_tz['from'] < 1970) { + $mdl_tz['from'] = 1970; } + $mdl_tz['from_timestamp'] = gmmktime(0, 0, 0, 1, 1, $mdl_tz['from'], 0) + $mdl_tz['gmtoff'] * 60 ; $mdl_zones[] = $mdl_tz; } }