diff --git a/src/common/TimeZoneUtil.cpp b/src/common/TimeZoneUtil.cpp index 8b83e76318f..712f3e8d5fc 100644 --- a/src/common/TimeZoneUtil.cpp +++ b/src/common/TimeZoneUtil.cpp @@ -1120,7 +1120,10 @@ bool TimeZoneRuleIterator::next() } if (!hasNext || icuDate > MAX_ICU_TIMESTAMP) + { icuDate = MAX_ICU_TIMESTAMP; + hasNext = false; + } icuLib.ucalSetMillis(icuCalendar, icuDate, &icuErrorCode); @@ -1130,7 +1133,7 @@ bool TimeZoneRuleIterator::next() (icuDate == MAX_ICU_TIMESTAMP ? ISC_TIME_SECONDS_PRECISION / 1000 : 0)); endTimestamp.time_zone = TimeZoneUtil::GMT_ZONE; - startTicks = endTicks + 1; + startTicks = (hasNext ? endTicks : toTicks) + 1; return true; }