Class LocalDate

java.lang.Object
com.atlassian.jira.datetime.LocalDate
All Implemented Interfaces:
Comparable<LocalDate>

public class LocalDate extends Object implements Comparable<LocalDate>
Represents a "Local Date" or "Calendar Date" - that is a date (no time) without any associated timezone.

LocalDate is only defined to handle years in the Common Era - it cannot handle dates that are BC.

Since:
v4.4
  • Constructor Details

    • LocalDate

      public LocalDate(long daysSinceEpoch)
      Creates a new LocalDate based on the number of days that have passed relative to the java epoch: 1970-01-01.
      Parameters:
      daysSinceEpoch - days since the java epoch. see @ java.time.LocalDate.ofEpochDay
      Since:
      8.0
    • LocalDate

      public LocalDate(int year, int month, int day)
  • Method Details

    • getYear

      public int getYear()
    • getMonth

      public int getMonth()
    • getDay

      public int getDay()
    • getEpochDays

      public long getEpochDays()
      Returns the number of days since this LocalDate and the java epoch, whose zero-day is set to 1970-01-01.
      Returns:
      # of days between this LocalDate and the java epoch.
    • getEarlierDate

      public LocalDate getEarlierDate(LocalDate that)
    • getLaterDate

      public LocalDate getLaterDate(LocalDate that)
    • plusDays

      public LocalDate plusDays(int days)
    • minusDays

      public LocalDate minusDays(int days)
    • plusMonths

      public LocalDate plusMonths(int months)
    • minusMonths

      public LocalDate minusMonths(int months)
    • plusYears

      public LocalDate plusYears(int years)
    • minusYears

      public LocalDate minusYears(int years)
    • 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
    • compareTo

      public int compareTo(LocalDate localDate)
      Specified by:
      compareTo in interface Comparable<LocalDate>