Interface CalendarDate

All Superinterfaces:
Temporal<CalendarDate>
All Known Implementing Classes:
BadiCalendar, CalendarVariant, Calendrical, ChineseCalendar, CopticCalendar, EastAsianCalendar, EthiopianCalendar, FrenchRepublicanCalendar, HebrewCalendar, HijriCalendar, HinduCalendar, HistoricCalendar, IndianCalendar, JapaneseCalendar, JucheCalendar, JulianCalendar, KoreanCalendar, MinguoCalendar, PersianCalendar, PlainDate, ThaiSolarCalendar, VietnameseCalendar

public interface CalendarDate extends Temporal<CalendarDate>

Represents a general calendar date.

Since:
3.8/4.5
Author:
Meno Hochschild
  • Method Details

    • getDaysSinceEpochUTC

      long getDaysSinceEpochUTC()

      Counts the elapsed days since UTC epoch.

      Returns:
      count of days relative to UTC epoch [1972-01-01]
      Since:
      3.8/4.5
      See Also:
      EpochDays.UTC
    • transform

      default <T extends Calendrical<?,​ T>> T transform(Chronology<T> target)

      Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].

      The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.

      Type Parameters:
      T - generic target date type
      Parameters:
      target - chronology this date shall be converted to
      Returns:
      converted date of target type T
      Throws:
      ArithmeticException - in case of numerical overflow
      Since:
      4.27
    • transform

      default <T extends CalendarVariant<T>> T transform(CalendarFamily<T> target, String variant)

      Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].

      The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.

      Type Parameters:
      T - generic target date type
      Parameters:
      target - chronology this date shall be converted to
      variant - desired calendar variant
      Returns:
      converted date of target type T
      Throws:
      ChronoException - if given variant is not recognized
      ArithmeticException - in case of numerical overflow
      Since:
      4.27
    • transform

      default <T extends CalendarVariant<T>> T transform(CalendarFamily<T> target, VariantSource variantSource)

      Converts this calendar date to the given target chronology based on the count of days relative to UTC epoch [1972-01-01].

      The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.

      Type Parameters:
      T - generic target date type
      Parameters:
      target - chronology this date shall be converted to
      variantSource - source of desired calendar variant
      Returns:
      converted date of target type T
      Throws:
      ChronoException - if the variant of given source is not recognized
      ArithmeticException - in case of numerical overflow
      Since:
      4.27
    • transform

      default <T extends Calendrical<?,​ T>> T transform(Class<T> target)

      Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].

      The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.

      Type Parameters:
      T - generic target date type
      Parameters:
      target - chronological type this date shall be converted to
      Returns:
      converted date of target type T
      Throws:
      IllegalArgumentException - if the target class does not have any chronology
      ArithmeticException - in case of numerical overflow
      Since:
      4.27
    • transform

      default <T extends CalendarVariant<T>> T transform(Class<T> target, String variant)

      Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].

      The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.

      Type Parameters:
      T - generic target date type
      Parameters:
      target - chronological type this date shall be converted to
      variant - desired calendar variant
      Returns:
      converted date of target type T
      Throws:
      ChronoException - if given variant is not recognized
      IllegalArgumentException - if the target class does not have any chronology
      ArithmeticException - in case of numerical overflow
      Since:
      4.27
    • transform

      default <T extends CalendarVariant<T>> T transform(Class<T> target, VariantSource variantSource)

      Converts this calendar date to the given target type based on the count of days relative to UTC epoch [1972-01-01].

      The conversion occurs on the local timeline at noon. This reference time ensures that all date types remain convertible even if a calendar system defines dates not starting at midnight.

      Type Parameters:
      T - generic target date type
      Parameters:
      target - chronological type this date shall be converted to
      variantSource - source of desired calendar variant
      Returns:
      converted date of target type T
      Throws:
      ChronoException - if the variant of given source is not recognized
      IllegalArgumentException - if the target class does not have any chronology
      ArithmeticException - in case of numerical overflow
      Since:
      4.27
    • from

      static <T extends CalendarVariant<T>> T from(ChronoLocalDate threeten, CalendarFamily<T> target, VariantSource variantSource)

      Converts the calendar date corresponding to ChronoLocalDate in given target chronology and variant.

      Type Parameters:
      T - type of target chronology
      Parameters:
      threeten - the ChronoLocalDate to be converted
      target - chronology given date shall be converted to
      variantSource - source of desired calendar variant
      Returns:
      converted date of target type T
      Throws:
      ChronoException - if the variant of given source is not recognized
      ArithmeticException - in case of numerical overflow
      Since:
      5.8
    • from

      static <T extends CalendarVariant<T>> T from(ChronoLocalDate threeten, CalendarFamily<T> target, String variant)

      Converts the calendar date corresponding to ChronoLocalDate in given target chronology and variant.

      Type Parameters:
      T - type of target chronology
      Parameters:
      threeten - the ChronoLocalDate to be converted
      target - chronology given date shall be converted to
      variant - desired calendar variant
      Returns:
      converted date of target type T
      Throws:
      ChronoException - if the variant of given source is not recognized
      ArithmeticException - in case of numerical overflow
      Since:
      5.8
    • from

      static <T extends Calendrical<?,​ T>> T from(ChronoLocalDate threeten, Chronology<T> target)

      Converts the calendar date corresponding to ChronoLocalDate in given target chronology.

      Type Parameters:
      T - type of target chronology
      Parameters:
      threeten - the ChronoLocalDate to be converted
      target - chronology given date shall be converted to
      Returns:
      converted date of target type T
      Throws:
      ArithmeticException - in case of numerical overflow
      Since:
      5.8