# Class OffsetDateTime

java.lang.Object
java.time.OffsetDateTime

All Implemented Interfaces:
  `Comparable<OffsetDateTime>, TemporalAccessor`

public final class OffsetDateTime extends java.lang.Object implements Comparable<OffsetDateTime>, TemporalAccessor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(OffsetDateTime other)`
  Compares this object to the specified object to determine their relative order.
  `boolean`
  `equals(java.lang.Object obj)`
  `String`
  `format(DateTimeFormatter formatter)`
  `ZoneOffset`
  `getOffset()`
  `int`
  `hashCode()`
  `static OffsetDateTime`
  `of(LocalDate date, LocalTime time, ZoneOffset offset)`
  `static OffsetDateTime`
  `of(LocalDateTime dateTime, ZoneOffset offset)`
  `static OffsetDateTime`
  `ofInstant(Instant instant, ZoneId zone)`
  `static OffsetDateTime`
  `parse(CharSequence text)`
  `static OffsetDateTime`
  `parse(CharSequence text, DateTimeFormatter formatter)`
  `Instant`
  `toInstant()`
  `LocalDateTime`
  `toLocalDateTime()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### of

    public static OffsetDateTime of(LocalDate date, LocalTime time, ZoneOffset offset)

  - ### of

    public static OffsetDateTime of(LocalDateTime dateTime, ZoneOffset offset)

  - ### ofInstant

    public static OffsetDateTime ofInstant(Instant instant, ZoneId zone)

  - ### parse

    public static OffsetDateTime parse(CharSequence text)

  - ### parse

    public static OffsetDateTime parse(CharSequence text, DateTimeFormatter formatter)

  - ### toLocalDateTime

    public LocalDateTime toLocalDateTime()

  - ### getOffset

    public ZoneOffset getOffset()

  - ### toInstant

    public Instant toInstant()

  - ### format

    public String format(DateTimeFormatter formatter)

  - ### compareTo

    public int compareTo(OffsetDateTime other)
    Description copied from interface: `Comparable`

    Compares this object to the specified object to determine their relative order.

    ###### Parameters

    - `another`: the object to compare to this instance.

    ###### Returns

    Specified by:
      `compareTo` in interface `Comparable<OffsetDateTime>`
    Returns:

      a negative integer if this instance is less than `another`; a positive integer if this instance is greater than `another`; 0 if this instance has the same order as `another`.

      ###### Throws

      - `ClassCastException`: @throws ClassCastException if `another` cannot be converted into something comparable to `this` instance.

  - ### equals

    public boolean equals(java.lang.Object obj)
    Overrides:
      `equals` in class `java.lang.Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `java.lang.Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `java.lang.Object`