Need non-proleptic Gregorian chronology in Java 8 (like org.joda.time.chrono.GJChronology)

John Caron :

I dont see the equivalent java.time.Chronology to org.joda.time.chrono.GJChronology.java, that is, a non-proleptic Gregorian Calendar ("the Gregorian/Julian calendar system which is the calendar system used in most of the world").

I know there is java.util.GregorianCalendar, but that doesnt implement java.time.Chronology. I need to allow user to specify the Chronology, so would be simplest to have a GregorianChronology class.

Is there some simple way to use GregorianCalendar to implement GregorianChronology? If its the "most used", why not include in java.time ??

Andreas :

They are not included in the Java Runtime Library, but you can find e.g. a Julian chronology in the ThreeTen-Extra project.

ThreeTen-Extra provides additional date-time classes that complement those in Java SE 8.

Don't know where you found that "most used" quote. The javadoc of org.joda.time.Chronology says:

ISO - The de facto world calendar system, based on the ISO-8601 standard

The javadoc of org.joda.time.chrono.ISOChronology says:

Implements a chronology that follows the rules of the ISO8601 standard, which is compatible with Gregorian for all modern dates.

In Java 8+, java.time.chrono.IsoChronology is the default chronology used by most of the API.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=126166&siteId=1