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 Summary
Modifier and TypeMethodDescriptionatStartOfDay(ZoneId zone) atTime(int hour, int minute) atTime(int hour, int minute, int second) atTime(int hour, int minute, int second, int nano) intCompares this object to the specified object to determine their relative order.booleanequals(java.lang.Object obj) format(DateTimeFormatter formatter) intintintgetYear()inthashCode()booleanintminusDays(long daysToSubtract) static LocalDatenow()static LocalDatestatic LocalDateof(int year, int month, int dayOfMonth) static LocalDateofEpochDay(long epochDay) static LocalDateparse(CharSequence text) static LocalDateparse(CharSequence text, DateTimeFormatter formatter) plusDays(long daysToAdd) plusMonths(long monthsToAdd) plusYears(long yearsToAdd) longtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
now
-
now
-
of
-
ofEpochDay
-
parse
-
parse
-
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
-
plusMonths
-
plusYears
-
minusDays
-
atTime
-
atTime
-
atTime
-
atTime
-
atStartOfDay
-
format
-
compareTo
Description copied from interface:ComparableCompares this object to the specified object to determine their relative order.
Parameters
another: the object to compare to this instance.
Returns
- Specified by:
compareToin interfaceComparable<LocalDate>- Returns:
a negative integer if this instance is less than
another; a positive integer if this instance is greater thananother; 0 if this instance has the same order asanother.Throws
ClassCastException: @throws ClassCastException ifanothercannot be converted into something comparable tothisinstance.
-
equals
public boolean equals(java.lang.Object obj) - Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
- Overrides:
toStringin classjava.lang.Object
-