Class SimpleDate
java.lang.Object
com.nimbusds.oauth2.sdk.util.date.SimpleDate
Simple date. Supports ISO 8601 formatting and parsing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getDay()
Returns the day of the month.int
getMonth()
Returns the month.int
getYear()
Returns the year.int
hashCode()
static SimpleDate
Parses an ISO 8601 representation inYYYY-MM-DD
format.Returns an ISO 8601 representation inYYYY-MM-DD
format.toString()
-
Constructor Details
-
SimpleDate
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
Returns the year.- Returns:
- The year.
-
getMonth
Returns the month.- Returns:
- The month.
-
getDay
Returns the day of the month.- Returns:
- The day of the month.
-
toISO8601String
Returns an ISO 8601 representation inYYYY-MM-DD
format.Example:
2019-11-01
- Returns:
- The ISO 8601 representation.
-
toString
-
equals
-
hashCode
-
parseISO8601String
Parses an ISO 8601 representation inYYYY-MM-DD
format.Example:
2019-11-01
- Parameters:
s
- The string to parse.- Returns:
- The simple date.
- Throws:
ParseException
- If parsing failed.
-