From 3ad7c1ad4afde96d52bddf41ccf282558d8485d9 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sat, 18 Jun 2005 11:58:18 +0000 Subject: [PATCH] - 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. --- ext/date/lib/parse_tz.c | 3 +++ 1 file changed, 3 insertions(+) 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]]); -- 2.40.0