# Class LocalTime

java.lang.Object
java.time.LocalTime

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

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final LocalTime`
  `MIDNIGHT`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(LocalTime other)`
  Compares this object to the specified object to determine their relative order.
  `boolean`
  `equals(java.lang.Object obj)`
  `String`
  `format(DateTimeFormatter formatter)`
  `int`
  `getHour()`
  `int`
  `getMinute()`
  `int`
  `getNano()`
  `int`
  `getSecond()`
  `int`
  `hashCode()`
  `static LocalTime`
  `now()`
  `static LocalTime`
  `now(Clock clock)`
  `static LocalTime`
  `of(int hour, int minute)`
  `static LocalTime`
  `of(int hour, int minute, int second)`
  `static LocalTime`
  `of(int hour, int minute, int second, int nano)`
  `static LocalTime`
  `ofNanoOfDay(long nanoOfDay)`
  `static LocalTime`
  `ofSecondOfDay(long secondOfDay)`
  `static LocalTime`
  `parse(CharSequence text)`
  `static LocalTime`
  `parse(CharSequence text, DateTimeFormatter formatter)`
  `LocalTime`
  `plusHours(long hoursToAdd)`
  `LocalTime`
  `plusMinutes(long minutesToAdd)`
  `LocalTime`
  `plusSeconds(long secondsToAdd)`
  `long`
  `toNanoOfDay()`
  `int`
  `toSecondOfDay()`
  `String`
  `toString()`

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

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

- ## Field Details

  - ### MIDNIGHT

    public static final LocalTime MIDNIGHT

- ## Method Details

  - ### now

    public static LocalTime now()

  - ### now

    public static LocalTime now(Clock clock)

  - ### of

    public static LocalTime of(int hour, int minute)

  - ### of

    public static LocalTime of(int hour, int minute, int second)

  - ### of

    public static LocalTime of(int hour, int minute, int second, int nano)

  - ### ofSecondOfDay

    public static LocalTime ofSecondOfDay(long secondOfDay)

  - ### ofNanoOfDay

    public static LocalTime ofNanoOfDay(long nanoOfDay)

  - ### parse

    public static LocalTime parse(CharSequence text)

  - ### parse

    public static LocalTime parse(CharSequence text, DateTimeFormatter formatter)

  - ### getHour

    public int getHour()

  - ### getMinute

    public int getMinute()

  - ### getSecond

    public int getSecond()

  - ### getNano

    public int getNano()

  - ### toSecondOfDay

    public int toSecondOfDay()

  - ### toNanoOfDay

    public long toNanoOfDay()

  - ### plusHours

    public LocalTime plusHours(long hoursToAdd)

  - ### plusMinutes

    public LocalTime plusMinutes(long minutesToAdd)

  - ### plusSeconds

    public LocalTime plusSeconds(long secondsToAdd)

  - ### format

    public String format(DateTimeFormatter formatter)

  - ### compareTo

    public int compareTo(LocalTime 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<LocalTime>`
    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`