Class LocalDate

java.lang.Object
java.time.LocalDate
All Implemented Interfaces:
Comparable<LocalDate>, TemporalAccessor

public final class LocalDate extends java.lang.Object implements Comparable<LocalDate>, TemporalAccessor
  • Method Details

    • now

      public static LocalDate now()
    • now

      public static LocalDate now(Clock clock)
    • of

      public static LocalDate of(int year, int month, int dayOfMonth)
    • ofEpochDay

      public static LocalDate ofEpochDay(long epochDay)
    • parse

      public static LocalDate parse(CharSequence text)
    • parse

      public static LocalDate parse(CharSequence text, DateTimeFormatter formatter)
    • getYear

      public int getYear()
    • getMonthValue

      public int getMonthValue()
    • getDayOfMonth

      public int getDayOfMonth()
    • isLeapYear

      public boolean isLeapYear()
    • lengthOfMonth

      public int lengthOfMonth()
    • toEpochDay

      public long toEpochDay()
    • plusDays

      public LocalDate plusDays(long daysToAdd)
    • plusMonths

      public LocalDate plusMonths(long monthsToAdd)
    • plusYears

      public LocalDate plusYears(long yearsToAdd)
    • minusDays

      public LocalDate minusDays(long daysToSubtract)
    • atTime

      public LocalDateTime atTime(int hour, int minute)
    • atTime

      public LocalDateTime atTime(int hour, int minute, int second)
    • atTime

      public LocalDateTime atTime(int hour, int minute, int second, int nano)
    • atTime

      public LocalDateTime atTime(LocalTime time)
    • atStartOfDay

      public ZonedDateTime atStartOfDay(ZoneId zone)
    • format

      public String format(DateTimeFormatter formatter)
    • compareTo

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