summaryrefslogtreecommitdiff
path: root/ext/date/lib/parse_tz.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2005-06-18 11:58:18 +0000
committerDerick Rethans <derick@php.net>2005-06-18 11:58:18 +0000
commit3ad7c1ad4afde96d52bddf41ccf282558d8485d9 (patch)
treea4a73e1804f48d75180cfd3da038414e95cb6bc9 /ext/date/lib/parse_tz.c
parent30efc9f68e39a8d572ecc1918f87b0ddee80a141 (diff)
downloadphp-git-3ad7c1ad4afde96d52bddf41ccf282558d8485d9.tar.gz
- If the ts is smaller than the first transition time, use the last one
in the list. #- This seems consistent with how "zdump" works, although I'm not 100% sure if # it's correct.
Diffstat (limited to 'ext/date/lib/parse_tz.c')
-rw-r--r--ext/date/lib/parse_tz.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index e88f3b2fe5..f0feff0352 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -228,6 +228,9 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts)
return NULL;
}
+ if (ts < tz->trans[0]) {
+ return &(tz->type[tz->trans_idx[tz->timecnt - 1]]);
+ }
for (i = 0; i < tz->timecnt; i++) {
if (ts < tz->trans[i]) {
return &(tz->type[tz->trans_idx[i - 1]]);