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.
This commit is contained in:
+3
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user