Class SimpleDate

java.lang.Object
com.nimbusds.oauth2.sdk.util.date.SimpleDate

public class SimpleDate extends Object
Simple date. Supports ISO 8601 formatting and parsing.
  • Constructor Details

    • SimpleDate

      public SimpleDate(int year, int month, int day)
      Creates a new simple date. No validation of month and day is performed.
      Parameters:
      year - The year.
      month - The month.
      day - The day of the month.
  • Method Details

    • getYear

      public int getYear()
      Returns the year.
      Returns:
      The year.
    • getMonth

      public int getMonth()
      Returns the month.
      Returns:
      The month.
    • getDay

      public int getDay()
      Returns the day of the month.
      Returns:
      The day of the month.
    • toISO8601String

      Returns an ISO 8601 representation in YYYY-MM-DD format.

      Example: 2019-11-01

      Returns:
      The ISO 8601 representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • parseISO8601String

      Parses an ISO 8601 representation in YYYY-MM-DD format.

      Example: 2019-11-01

      Parameters:
      s - The string to parse.
      Returns:
      The simple date.
      Throws:
      ParseException - If parsing failed.