# Class LocalDateTime

java.lang.Object
java.time.LocalDateTime

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

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(LocalDateTime other)`
  Compares this object to the specified object to determine their relative order.
  `boolean`
  `equals(java.lang.Object obj)`
  `String`
  `format(DateTimeFormatter formatter)`
  `int`
  `getDayOfMonth()`
  `int`
  `getHour()`
  `int`
  `getMinute()`
  `int`
  `getMonthValue()`
  `int`
  `getNano()`
  `int`
  `getSecond()`
  `int`
  `getYear()`
  `int`
  `hashCode()`
  `static LocalDateTime`
  `now()`
  `static LocalDateTime`
  `now(Clock clock)`
  `static LocalDateTime`
  `of(int year, int month, int dayOfMonth, int hour, int minute)`
  `static LocalDateTime`
  `of(int year, int month, int dayOfMonth, int hour, int minute, int second)`
  `static LocalDateTime`
  `of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nano)`
  `static LocalDateTime`
  `of(LocalDate date, LocalTime time)`
  `static LocalDateTime`
  `ofInstant(Instant instant, ZoneId zone)`
  `static LocalDateTime`
  `parse(CharSequence text)`
  `static LocalDateTime`
  `parse(CharSequence text, DateTimeFormatter formatter)`
  `LocalDateTime`
  `plusDays(long days)`
  `LocalDateTime`
  `plusHours(long hours)`
  `LocalDateTime`
  `plusMinutes(long minutes)`
  `LocalDateTime`
  `plusSeconds(long seconds)`
  `Instant`
  `toInstant(ZoneOffset offset)`
  `LocalDate`
  `toLocalDate()`
  `LocalTime`
  `toLocalTime()`
  `String`
  `toString()`

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

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

- ## Method Details

  - ### now

    public static LocalDateTime now()

  - ### now

    public static LocalDateTime now(Clock clock)

  - ### of

    public static LocalDateTime of(LocalDate date, LocalTime time)

  - ### of

    public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute)

  - ### of

    public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second)

  - ### of

    public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nano)

  - ### ofInstant

    public static LocalDateTime ofInstant(Instant instant, ZoneId zone)

  - ### parse

    public static LocalDateTime parse(CharSequence text)

  - ### parse

    public static LocalDateTime parse(CharSequence text, DateTimeFormatter formatter)

  - ### toLocalDate

    public LocalDate toLocalDate()

  - ### toLocalTime

    public LocalTime toLocalTime()

  - ### getYear

    public int getYear()

  - ### getMonthValue

    public int getMonthValue()

  - ### getDayOfMonth

    public int getDayOfMonth()

  - ### getHour

    public int getHour()

  - ### getMinute

    public int getMinute()

  - ### getSecond

    public int getSecond()

  - ### getNano

    public int getNano()

  - ### plusDays

    public LocalDateTime plusDays(long days)

  - ### plusHours

    public LocalDateTime plusHours(long hours)

  - ### plusMinutes

    public LocalDateTime plusMinutes(long minutes)

  - ### plusSeconds

    public LocalDateTime plusSeconds(long seconds)

  - ### toInstant

    public Instant toInstant(ZoneOffset offset)

  - ### format

    public String format(DateTimeFormatter formatter)

  - ### compareTo

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