Example usage for java.time.zone ZoneRules getTransitions

List of usage examples for java.time.zone ZoneRules getTransitions

Introduction

In this page you can find the example usage for java.time.zone ZoneRules getTransitions.

Prototype

public List<ZoneOffsetTransition> getTransitions() 

Source Link

Document

Gets the complete list of fully defined transitions.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDateTime now = LocalDateTime.now();
    ZoneId usChicago = ZoneId.of("America/Chicago");
    System.out.println("Zone ID:  " + usChicago.getId());

    ZoneRules rules = usChicago.getRules();
    System.out.println("isFixedOffset(): " + rules.isFixedOffset());
    ZoneOffset offset = rules.getOffset(now);
    System.out.println("Zone offset: " + offset);

    List<ZoneOffsetTransition> transitions = rules.getTransitions();
    System.out.println(transitions);

}