Package: java.time

## [Java] Class ZoneOffset

- java.time.ZoneOffset

-     public class ZoneOffset
      extends Object

  GDK enhancements for ZoneOffset.

  displayName:
    ZoneOffset
  receiverFqcn:
    java.time.ZoneOffset

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public long` | `getAt(TemporalField field)` Supports the getAt operator; equivalent to calling the ZoneOffset.getLong method.
    `` | `public int` | `getHours()` Returns the hours component of this offset.
    `` | `public int` | `getMinutes()` Returns the minutes component of this offset.
    `` | `public int` | `getSeconds()` Returns the seconds component of this offset.
    `` | `public OffsetDateTime` | `leftShift(LocalDateTime dateTime)` Returns an OffsetDateTime of this offset and the provided LocalDateTime.
    `` | `public OffsetTime` | `leftShift(LocalTime time)` Returns an OffsetDateTime of this offset and the provided LocalTime.
    `` | `public static ZoneOffset` | `systemDefault(ZoneOffset type)` Returns the ZoneOffset currently associated with the system default ZoneId.
    `` | `public TimeZone` | `toTimeZone()` Returns a generally equivalent TimeZone.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public long getAt(TemporalField field)

      Supports the getAt operator; equivalent to calling the ZoneOffset.getLong method.

      Parameters:
        `field` - a TemporalField
      Returns:
        the ZoneOffset's field value
      Since:
        2.5.0

    - #### public int getHours()

      Returns the hours component of this offset. If the offset's total seconds are negative, a negative value will be returned.

      Returns:
        the hours component value
      Since:
        2.5.0

    - #### public int getMinutes()

      Returns the minutes component of this offset. If the offset's total seconds are negative, a negative value will be returned.

      Returns:
        the minutes component value
      Since:
        2.5.0

    - #### public int getSeconds()

      Returns the seconds component of this offset. This is not the same as the total seconds. For example:

               def offset = ZoneOffset.ofHoursMinutesSeconds(0, 1, 1)
               assert offset.seconds == 1
               assert offset.totalSeconds == 61

      If the offset's total seconds are negative, a negative value will be returned.

      Returns:
        the seconds component value
      Since:
        2.5.0

    - #### public OffsetDateTime leftShift(LocalDateTime dateTime)

      Returns an OffsetDateTime of this offset and the provided LocalDateTime.

      Parameters:
        `dateTime` - a LocalDateTime
      Returns:
        an OffsetDateTime
      Since:
        2.5.0

    - #### public OffsetTime leftShift(LocalTime time)

      Returns an OffsetDateTime of this offset and the provided LocalTime.

      Parameters:
        `time` - a LocalTime
      Returns:
        an OffsetTime
      Since:
        2.5.0

    - #### public static ZoneOffset systemDefault(ZoneOffset type)

      Returns the ZoneOffset currently associated with the system default ZoneId.

      Parameters:
        `type` - placeholder variable used by Groovy categories; ignored for default static methods
      Returns:
        a ZoneOffset
      See Also:
        ZoneId.systemDefault
      Since:
        2.5.0

    - #### public TimeZone toTimeZone()

      Returns a generally equivalent TimeZone. The offset will be truncated to minutes.

      Returns:
        a TimeZone
      Since:
        2.5.0