org.threeten.bp

chrono

package chrono

Support for calendar systems other than the default ISO.

The main API is based around the calendar system defined in ISO-8601. This package provides support for alternate systems.

The supported calendar systems includes:

-plain org.threeten.bp.chrono.HijrahChronology Hijrah calendar -plain org.threeten.bp.chrono.JapaneseChronology Japanese calendar -plain org.threeten.bp.chrono.MinguoChronology Minguo calendar -plain org.threeten.bp.chrono.ThaiBuddhistChronology Thai Buddhist calendar

It is intended that applications use the main API whenever possible, including code to read and write from a persistent data store, such as a database, and to send dates and times across a network. This package is then used at the user interface level to deal with localized input/output. See org.threeten.bp.chrono.ChronoLocalDate ChronoLocalDate for a full discussion of the issues.

Example

This example creates and uses a date in a non-ISO calendar system.

        // Print the Thai Buddhist date
        ChronoLocalDate now1 = ThaiBuddhistChronology.INSTANCE.now();
        int day = now1.get(ChronoField.DAY_OF_MONTH);
        int dow = now1.get(ChronoField.DAY_OF_WEEK);
        int month = now1.get(ChronoField.MONTH_OF_YEAR);
        int year = now1.get(ChronoField.YEAR);
        System.out.printf("  Today is %s %s %d-%s-%d%n", now1.getChronology().getId(),
                dow, day, month, year);

        // Enumerate the list of available calendars and print today for each
        Set<String> names = Chronology.getAvailableIds();
        for (String name : names) {
            Chronology<?> chrono = Chronology.of(name);
            ChronoLocalDate<?> date = chrono.now();
            System.out.printf("   %20s: %s%n", chrono.getId(), date.toString());
        }

        // Print today's date and the last day of the year for the Thai Buddhist Calendar.
        ChronoLocalDate first = now1
                .with(ChronoField.DAY_OF_MONTH, 1)
                .with(ChronoField.MONTH_OF_YEAR, 1);
        ChronoLocalDate last = first
                .plus(1, ChronoUnit.YEARS)
                .minus(1, ChronoUnit.DAYS);
        System.out.printf("  %s: 1st of year: %s; end of year: %s%n", last.getChronology().getId(),
                first, last);

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. chrono
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AbstractChronology extends Chronology

    An abstract implementation of Chronology.

  2. abstract class ChronoDateImpl[D <: ChronoLocalDate] extends ChronoLocalDate with Temporal with TemporalAdjuster with Serializable

    A date expressed in terms of a standard year-month-day calendar system.

  3. trait ChronoLocalDate extends Temporal with TemporalAdjuster with Ordered[ChronoLocalDate]

    A date without time-of-day or time-zone in an arbitrary chronology, intended for advanced globalization use cases.

  4. abstract class ChronoLocalDateTime[D <: ChronoLocalDate] extends Temporal with TemporalAdjuster with Ordered[ChronoLocalDateTime[_]]

  5. final class ChronoLocalDateTimeImpl[D <: ChronoLocalDate] extends ChronoLocalDateTime[D] with Temporal with TemporalAdjuster with Serializable

    A date-time without a time-zone for the calendar neutral API.

  6. trait ChronoPeriod extends TemporalAmount

    A date-based amount of time, such as '3 years, 4 months and 5 days' in an arbitrary chronology, intended for advanced globalization use cases.

  7. final class ChronoPeriodImpl extends ChronoPeriod with Serializable

    An implementation of ChronoPeriod.

  8. trait ChronoZonedDateTime[D <: ChronoLocalDate] extends Temporal with Ordered[ChronoZonedDateTime[_]]

    A date-time with a time-zone in an arbitrary chronology, intended for advanced globalization use cases.

  9. final class ChronoZonedDateTimeImpl[D <: ChronoLocalDate] extends ChronoZonedDateTime[D] with Serializable

    A date-time with a time-zone in the calendar neutral API.

  10. trait Chronology extends Ordered[Chronology]

    A calendar system, used to organize and identify dates.

  11. trait Era extends TemporalAccessor with TemporalAdjuster

    An era of the time-line.

  12. final class HijrahChronology extends Chronology with Serializable

    The Hijrah calendar system.

  13. final class HijrahDate extends ChronoDateImpl[HijrahDate] with Serializable

    A date in the Hijrah calendar system.

  14. final class HijrahEra extends Enum[HijrahEra] with Era

    An era in the Hijrah calendar system.

  15. final class IsoChronology extends Chronology with Serializable

    The ISO calendar system.

  16. final class IsoEra extends Enum[IsoEra] with Era

    An era in the ISO calendar system.

  17. final class JapaneseChronology extends Chronology with Serializable

    The Japanese Imperial calendar system.

  18. final class JapaneseDate extends ChronoDateImpl[JapaneseDate] with Serializable

    A date in the Japanese Imperial calendar system.

  19. final class JapaneseEra extends Era with Serializable

    An era in the Japanese Imperial calendar system.

  20. final class MinguoChronology extends Chronology with Serializable

    The Minguo calendar system.

  21. final class MinguoDate extends ChronoDateImpl[MinguoDate] with Serializable

    A date in the Minguo calendar system.

  22. final class MinguoEra extends Enum[MinguoEra] with Era

    An era in the Minguo calendar system.

  23. final class Ser extends Externalizable

    The shared serialization delegate for this package.

  24. final class ThaiBuddhistChronology extends Chronology with Serializable

    The Thai Buddhist calendar system.

  25. final class ThaiBuddhistDate extends ChronoDateImpl[ThaiBuddhistDate] with Serializable

    A date in the Thai Buddhist calendar system.

  26. final class ThaiBuddhistEra extends Enum[ThaiBuddhistEra] with Era

    An era in the Thai Buddhist calendar system.

Value Members

  1. object ChronoLocalDate

  2. object ChronoLocalDateTime

  3. object ChronoPeriod

  4. object ChronoZonedDateTime

  5. object Chronology

  6. object HijrahChronology extends Serializable

    Annotations
    @SerialVersionUID( 3127340209035924785L )
  7. object HijrahDate extends Serializable

    Annotations
    @SerialVersionUID( 5207853542612002020L )
  8. object HijrahDateConfigurator

  9. object HijrahEra extends Serializable

  10. object IsoChronology extends Serializable

    Annotations
    @SerialVersionUID( 1440403870442975015L )
  11. object IsoEra extends Serializable

  12. object JapaneseChronology extends Serializable

    Annotations
    @SerialVersionUID( 459996390165777884L )
  13. object JapaneseDate extends Serializable

    Annotations
    @SerialVersionUID( 305327627230580483L )
  14. object JapaneseEra extends Serializable

    Annotations
    @SerialVersionUID( 1466499369062886794L )
  15. object MinguoChronology extends Serializable

    Annotations
    @SerialVersionUID( 1039765215346859963L )
  16. object MinguoDate extends Serializable

    Annotations
    @SerialVersionUID( 1300372329181994526L )
  17. object MinguoEra extends Serializable

  18. object ThaiBuddhistChronology extends Serializable

    Annotations
    @SerialVersionUID( 2775954514031616474L )
  19. object ThaiBuddhistDate extends Serializable

    Annotations
    @SerialVersionUID( 8722293800195731463L )
  20. object ThaiBuddhistEra extends Serializable

  21. package internal

Inherited from AnyRef

Inherited from Any

Ungrouped