pstanton pstanton - 1 year ago 103
Java Question

Determine future timezone transitions

I need to predict when the next at least 2 timezone transitions will be for a particular timezone.

Java 8 offers the new

API, specifically
looks like exactly what I need however it doesn't list anything beyond the year 2010 for "Australia/Sydney".

What is the most reliable way to determine the next 2 timezone transition's date/time/offset?

Answer Source

The method ZoneRules.getTransitions() doesn't list all transitions until infinity into the future (obviously). This gets the next two transitions:

ZoneId zoneId = ZoneId.of("Australia/Sydney");
ZoneRules rules = zoneId.getRules();

ZoneOffsetTransition nextTransition = rules.nextTransition(;
System.out.println("Next transition at: " +

ZoneOffsetTransition nextNextTransition =
System.out.println("Next transition after that at: " +


Next transition at: 2016-10-02T03:00+11:00[Australia/Sydney]

Next transition after that at: 2017-04-02T02:00+10:00[Australia/Sydney]

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download