Example usage for java.time ZoneOffset get

List of usage examples for java.time ZoneOffset get

Introduction

In this page you can find the example usage for java.time ZoneOffset get.

Prototype

@Override 
public int get(TemporalField field) 

Source Link

Document

Gets the value of the specified field from this offset as an int .

Usage

From source file:Main.java

public static void main(String[] args) {
    ZoneOffset z = ZoneOffset.UTC;
    int t = z.get(ChronoField.OFFSET_SECONDS);
    System.out.println(t);/*  w w w.  j  a v a2s . c o  m*/
}

From source file:com.hotelbeds.hotelapimodel.auto.util.AssignUtils.java

public static BigInteger getHourDifference(final ZoneOffset zoneOffset) {
    return zoneOffset != null
            ? BigInteger.valueOf(Long.valueOf(zoneOffset.get(ChronoField.OFFSET_SECONDS)) / HOUR_SECONDS)
            : null;/*  ww  w .  j a v  a  2  s  .  co  m*/
}