GregorianJulian (GJ) calendar system

The GregorianJulian calendar system is the fusion of the two calendar systems in the Christian or Roman tradition. This calendar system is widely used today throughout the world, and is especially useful for historical work.

The GregorianJulian calendar is a combination of two separate calendar systems, the Gregorian and the Julian. The switch from one to the other occurs at a configurable date. The default date is 1582-10-15, as defined by Pope Gregory XIII.

The two calendar systems differ mainly in their accuracy of recording leap years. The Julian calendar defines a leap year as being once every four years. The Gregorian calendar adds two extra rules to state that years divisible by 100 are not leap, but those divisible by 400 are.

Joda-Time defines this calendar system using the GJChronology. This is a replacement for the JDK GregorianCalendar. If you intend to only refer to modern dates (after 1583) then you should use the Joda-Time default of ISO chronology.


Using GregorianJulian in Joda-Time

Within Joda-Time the GregorianJulian calendar system can be used by obtaining an instance of GJChronology. This is normally created using the factory method GJChronology.getInstance(). This is then passed into the constructors of the main date and time classes.

// setup date object for the Battle of Hastings in 1066
Chronology chrono = GJChronology.getInstance();
DateTime dt = new DateTime(1066, 10, 14, 10, 0, 0, 0, chrono);

If you want to change the cutover date between Julian and Gregorian, you will need to use the other factory methods on GJChronology.

Back to top

Version: 2.9.7. Last Published: 2016-12-19.

Reflow Maven skin by Andrius Velykis.