Interface Date

All Superinterfaces:
Comparable<Date>
All Known Implementing Classes:
DateImpl

public interface Date extends Comparable<Date>
  • Method Details

    • getDay

      int getDay()
    • getMonth

      int getMonth()
    • getYear

      int getYear()
    • toLocalDate

      LocalDate toLocalDate()
    • of

      static Date of(int year, int month, int dayOfMonth)
    • of

      static Date of(LocalDate localDate)
    • parse

      static Date parse(String text)
      Obtains an instance of Date from a text string such as 2007-12-03.

      The string must represent a valid date and is parsed using DateTimeFormatter.ISO_LOCAL_DATE.

      Parameters:
      text - the text to parse such as "2007-12-03", not null
      Returns:
      the parsed local date, not null
      Throws:
      DateTimeParseException - if the text cannot be parsed
    • of

      static LocalDateTime of(Date date, LocalTime time)