Interface GregorianDate

All Known Implementing Classes:
PlainDate, PlainTimestamp

public interface GregorianDate

Defines a common calendar date which is based on gregorian calendar rules.

Author:
Meno Hochschild
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Yields the day of month.
    int
    Yields the gregorian month as integer.
    int
    Yields the proleptic year according to ISO-8601.
    Yields a canonical representation in ISO-format "YYYY-MM-DD".
  • Method Details

    • getYear

      int getYear()

      Yields the proleptic year according to ISO-8601.

      The term proleptic means that the gregorian calendar rules are applied backwards even before the introduction of this calendar. Second: The year numbering is just the mathematical one as defined in ISO-8601 such that there is a year zero and even negative years: -2 = BC 3, -1 = BC 2, 0 = BC 1, 1 = AD 1, 2 = AD 2, ...

      Returns:
      proleptic iso year in range GregorianMath.MIN_YEAR - GregorianMath.MAX_YEAR
    • getMonth

      int getMonth()

      Yields the gregorian month as integer.

      Returns:
      gregorian month in range (1 = January, ..., 12 = December)
    • getDayOfMonth

      int getDayOfMonth()

      Yields the day of month.

      Returns:
      day of month in range 1 <= dayOfMonth <= 31
    • toString

      String toString()

      Yields a canonical representation in ISO-format "YYYY-MM-DD".

      Overrides:
      toString in class Object
      Returns:
      date in ISO-8601-format YYYY-MM-DD