Package: java.time

## [Java] Class OffsetTime

- java.time.OffsetTime

-     public class OffsetTime
      extends Object

  GDK enhancements for OffsetTime.

  displayName:
    OffsetTime
  receiverFqcn:
    java.time.OffsetTime

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public String` | `format(String pattern)` Formats this time with the provided DateTimeFormatter pattern.
    `` | `public String` | `format(FormatStyle timeStyle)` Formats this time in the provided, localized FormatStyle.
    `` | `public String` | `getTimeString()` Formats this time with the DateTimeFormatter.ISO_OFFSET_TIME formatter.
    `` | `public OffsetDateTime` | `leftShift(LocalDate date)` Returns an OffsetDateTime of this time and the provided LocalDate.
    `` | `public OffsetTime` | `minus(long seconds)` Returns an OffsetTime that is `seconds` seconds before this time.
    `` | `public OffsetTime` | `next()` Returns an OffsetTime that is one second after this time.
    `` | `public static OffsetTime` | `parse(OffsetTime type, CharSequence text, String pattern)` Parse text into an OffsetTime using the provided pattern.
    `` | `public OffsetTime` | `plus(long seconds)` Returns an OffsetTime that is `seconds` seconds after this time.
    `` | `public OffsetTime` | `previous()` Returns an OffsetTime that is one second before this time.
    `` | `public Calendar` | `toCalendar()` Returns a generally equivalent instance of Calendar.
    `` | `public Date` | `toDate()` Returns a generally equivalent instance of Date.

  - ### 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, 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 String format(String pattern)

      Formats this time with the provided DateTimeFormatter pattern.

      Parameters:
        `pattern` - the formatting pattern
      Returns:
        a formatted String
      See Also:
        DateTimeFormatter
      Since:
        2.5.0

    - #### public String format(FormatStyle timeStyle)

      Formats this time in the provided, localized FormatStyle.

      Parameters:
        `timeStyle` - the FormatStyle
      Returns:
        a formatted String
      See Also:
        DateTimeFormatter
      Since:
        2.5.0

    - #### public String getTimeString()

      Formats this time with the DateTimeFormatter.ISO_OFFSET_TIME formatter.

      Returns:
        a formatted String
      See Also:
        DateTimeFormatter
      Since:
        2.5.0

    - #### public OffsetDateTime leftShift(LocalDate date)

      Returns an OffsetDateTime of this time and the provided LocalDate.

      Parameters:
        `date` - a LocalDate
      Returns:
        an OffsetDateTime
      Since:
        2.5.0

    - #### public OffsetTime minus(long seconds)

      Returns an OffsetTime that is `seconds` seconds before this time.

      Parameters:
        `seconds` - the number of seconds to subtract
      Returns:
        an OffsetTime
      Since:
        2.5.0

    - #### public OffsetTime next()

      Returns an OffsetTime that is one second after this time.

      Returns:
        an OffsetTime
      Since:
        2.5.0

    - #### public static OffsetTime parse(OffsetTime type, CharSequence text, String pattern)

      Parse text into an OffsetTime using the provided pattern.

      throws:
        java.lang.IllegalArgumentException if the pattern is invalid
      throws:
        java.time.format.DateTimeParseException if the text cannot be parsed
      Parameters:
        `type` - placeholder variable used by Groovy categories; ignored for default static methods
        `text` - String to be parsed to create the date instance
        `pattern` - pattern used to parse the text
      Returns:
        an OffsetTime representing the parsed text
      See Also:
        DateTimeFormatter
        OffsetTime.parse
      Since:
        2.5.0

    - #### public OffsetTime plus(long seconds)

      Returns an OffsetTime that is `seconds` seconds after this time.

      Parameters:
        `seconds` - the number of seconds to add
      Returns:
        an OffsetTime
      Since:
        2.5.0

    - #### public OffsetTime previous()

      Returns an OffsetTime that is one second before this time.

      Returns:
        an OffsetTime
      Since:
        2.5.0

    - #### public Calendar toCalendar()

      Returns a generally equivalent instance of Calendar. The date value of the returned calendar is now, the time value is truncated to milliseconds, and the time zone is based on the offset of this time.

      Returns:
        a java.util.Calendar
      Since:
        2.5.0

    - #### public Date toDate()

      Returns a generally equivalent instance of Date. The time value of the returned date is truncated to milliseconds and will be adjusted to the current system default time zone.

      Returns:
        a java.util.Date
      Since:
        2.5.0