public final class LocalDate
extends java.lang.Object
Note that ISO 8601 has a number of differences with the default gregorian calendar used in Java:
This class implements these differences, so that year/month/day fields match exactly the ones in CQL string literals.
| Modifier and Type | Method and Description |
|---|---|
LocalDate |
add(int field,
int amount)
Return a new
LocalDate with the specified (signed) amount of time added to (or
subtracted from) the given Calendar field, based on the calendar's rules. |
boolean |
equals(java.lang.Object o) |
int |
getDay()
Returns the day in the month.
|
int |
getMonth()
Returns the month.
|
int |
getYear()
Returns the year.
|
int |
hashCode() |
java.lang.String |
toString() |
public int getYear()
public int getMonth()
public int getDay()
public LocalDate add(int field, int amount)
LocalDate with the specified (signed) amount of time added to (or
subtracted from) the given Calendar field, based on the calendar's rules.
Note that adding any amount to a field smaller than Calendar.DAY_OF_MONTH will
remain without effect, as this class does not keep time components.
See Calendar javadocs for more information.
field - a Calendar field to modify.amount - the amount of date or time to be added to the field.LocalDate with the specified (signed) amount of time added to (or
subtracted from) the given Calendar field.java.lang.IllegalArgumentException - if the new date is not in the range [-5877641-06-23;
5881580-07-11].public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2009-2020 The Apache Software Foundation