java.time.zone.ZoneRules#nextTransition is not return the DST change of Europe/Moscow 1991, that I cannot get the DST boundary of Europe/Moscow 1991.
Europe/Moscow entered daylight saving on 1991-03-31 02:00 but also changed their standard offset, so the offset (+03:00) keep unchanged while no Java API can be used to get such a boundary of DST start.
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.zone.ZoneOffsetTransition;
public class TimeUtilTest {
public static void main(String[] args) {
ZoneId tz = ZoneId.of("Europe/Moscow");
ZonedDateTime yearBegin = ZonedDateTime.of(1991, 1, 1, 0, 0, 0, 0, tz);
ZoneOffsetTransition nextTransition = tz.getRules().nextTransition(yearBegin.toInstant());
System.out.println("year begin isDST=" + tz.getRules().isDaylightSavings(yearBegin.toInstant()));
System.out.println("next transition before is " + nextTransition.getDateTimeBefore() + " isDST=" + tz.getRules()
.isDaylightSavings(nextTransition.getInstant().minusNanos(1)));
System.out.println("next transition after is " + nextTransition.getDateTimeAfter() + " isDST=" + tz.getRules()
.isDaylightSavings(nextTransition.getInstant().plusNanos(1)));
}
}
It returns below
year begin isDST=false
next transition before is 1991-09-29T03:00 isDST=true
next transition after is 1991-09-29T02:00 isDST=false
where you can see isDST was changed unexpectedly before the transition.