public class LocalDate extends Object implements Comparable<LocalDate>
LocalDate is only defined to handle years in the Common Era - it cannot handle dates that are BC.
Constructor and Description |
---|
LocalDate(int year,
int month,
int day) |
LocalDate(long daysSinceEpoch)
Creates a new LocalDate based on the number of days that have passed relative to the
java epoch: 1970-01-01.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(LocalDate localDate) |
boolean |
equals(Object o) |
int |
getDay() |
LocalDate |
getEarlierDate(LocalDate that) |
long |
getEpochDays()
Returns the number of days since this LocalDate and the java epoch, whose zero-day is set to
1970-01-01.
|
LocalDate |
getLaterDate(LocalDate that) |
int |
getMonth() |
int |
getYear() |
int |
hashCode() |
LocalDate |
minusDays(int days) |
LocalDate |
minusMonths(int months) |
LocalDate |
minusYears(int years) |
LocalDate |
plusDays(int days) |
LocalDate |
plusMonths(int months) |
LocalDate |
plusYears(int years) |
String |
toString() |
public LocalDate(long daysSinceEpoch)
daysSinceEpoch
- days since the java epoch. see @ java.time.LocalDate.ofEpochDaypublic LocalDate(int year, int month, int day)
public int getYear()
public int getMonth()
public int getDay()
public long getEpochDays()
public LocalDate plusDays(int days)
public LocalDate minusDays(int days)
public LocalDate plusMonths(int months)
public LocalDate minusMonths(int months)
public LocalDate plusYears(int years)
public LocalDate minusYears(int years)
public int compareTo(LocalDate localDate)
compareTo
in interface Comparable<LocalDate>
Copyright © 2002-2021 Atlassian. All Rights Reserved.
View cookie preferences