Example usage for java.time.zone ZoneRules isFixedOffset

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

Introduction

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

Prototype

public boolean isFixedOffset() 

Source Link

Document

Checks of the zone rules are fixed, such that the offset never varies.

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);

}