| java.lang.Object org.joda.time.Chronology org.joda.time.chrono.BaseChronology org.joda.time.chrono.AssembledChronology org.joda.time.chrono.GJChronology
GJChronology | final public class GJChronology extends AssembledChronology (Code) | | Implements the Gregorian/Julian calendar system which is the calendar system
used in most of the world. Wherever possible, it is recommended to use the
ISOChronology instead.
The Gregorian calendar replaced the Julian calendar, and the point in time
when this chronology switches can be controlled using the second parameter
of the getInstance method. By default this cutover is set to the date the
Gregorian calendar was first instituted, October 15, 1582.
Before this date, this chronology uses the proleptic Julian calendar
(proleptic means extending indefinitely). The Julian calendar has leap years
every four years, whereas the Gregorian has special rules for 100 and 400
years. A meaningful result will thus be obtained for all input values.
However before 8 CE, Julian leap years were irregular, and before 45 BCE
there was no Julian calendar.
This chronology differs from
java.util.GregorianCalendar GregorianCalendar in that years
in BCE are returned correctly. Thus year 1 BCE is returned as -1 instead of 1.
The yearOfEra field produces results compatible with GregorianCalendar.
The Julian calendar does not have a year zero, and so year -1 is followed by
year 1. If the Gregorian cutover date is specified at or before year -1
(Julian), year zero is defined. In other words, the proleptic Gregorian
chronology used by this class has a year zero.
To create a pure proleptic Julian chronology, use
JulianChronology ,
and to create a pure proleptic Gregorian chronology, use
GregorianChronology .
GJChronology is thread-safe and immutable.
author: Brian S O'Neill author: Stephen Colebourne since: 1.0 |
Method Summary | |
protected void | assemble(Fields fields) | public long | getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay) | public long | getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) | public Instant | getGregorianCutover() Gets the cutover instant between Gregorian and Julian chronologies. | public static GJChronology | getInstance() Factory method returns instances of the default GJ cutover
chronology. | public static GJChronology | getInstance(DateTimeZone zone) Factory method returns instances of the GJ cutover chronology. | public static GJChronology | getInstance(DateTimeZone zone, ReadableInstant gregorianCutover) Factory method returns instances of the GJ cutover chronology. | public static synchronized GJChronology | getInstance(DateTimeZone zone, ReadableInstant gregorianCutover, int minDaysInFirstWeek) Factory method returns instances of the GJ cutover chronology. | public static GJChronology | getInstance(DateTimeZone zone, long gregorianCutover, int minDaysInFirstWeek) Factory method returns instances of the GJ cutover chronology. | public static GJChronology | getInstanceUTC() Factory method returns instances of the default GJ cutover
chronology. | public int | getMinimumDaysInFirstWeek() Gets the minimum days needed for a week to be the first week in a year. | public DateTimeZone | getZone() | long | gregorianToJulianByWeekyear(long instant) | long | gregorianToJulianByYear(long instant) | long | julianToGregorianByWeekyear(long instant) | long | julianToGregorianByYear(long instant) | public String | toString() Gets a debugging toString. | public Chronology | withUTC() Gets the Chronology in the UTC time zone. | public Chronology | withZone(DateTimeZone zone) Gets the Chronology in a specific time zone. |
DEFAULT_CUTOVER | final static Instant DEFAULT_CUTOVER(Code) | | The default GregorianJulian cutover point.
|
assemble | protected void assemble(Fields fields)(Code) | | |
getDateTimeMillis | public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException(Code) | | |
getGregorianCutover | public Instant getGregorianCutover()(Code) | | Gets the cutover instant between Gregorian and Julian chronologies.
the cutover instant |
getInstance | public static GJChronology getInstance()(Code) | | Factory method returns instances of the default GJ cutover
chronology. This uses a cutover date of October 15, 1582 (Gregorian)
00:00:00 UTC. For this value, October 4, 1582 (Julian) is followed by
October 15, 1582 (Gregorian).
The first day of the week is designated to be
org.joda.time.DateTimeConstants.MONDAY Monday ,
and the minimum days in the first week of the year is 4.
The returned chronology is in the default time zone.
|
getInstance | public static GJChronology getInstance(DateTimeZone zone)(Code) | | Factory method returns instances of the GJ cutover chronology. This uses
a cutover date of October 15, 1582 (Gregorian) 00:00:00 UTC. For this
value, October 4, 1582 (Julian) is followed by October 15, 1582
(Gregorian).
The first day of the week is designated to be
org.joda.time.DateTimeConstants.MONDAY Monday ,
and the minimum days in the first week of the year is 4.
Parameters: zone - the time zone to use, null is default |
getInstance | public static GJChronology getInstance(DateTimeZone zone, ReadableInstant gregorianCutover)(Code) | | Factory method returns instances of the GJ cutover chronology. Any
cutover date may be specified.
The first day of the week is designated to be
org.joda.time.DateTimeConstants.MONDAY Monday ,
and the minimum days in the first week of the year is 4.
Parameters: zone - the time zone to use, null is default Parameters: gregorianCutover - the cutover to use, null means default |
getInstance | public static synchronized GJChronology getInstance(DateTimeZone zone, ReadableInstant gregorianCutover, int minDaysInFirstWeek)(Code) | | Factory method returns instances of the GJ cutover chronology. Any
cutover date may be specified.
Parameters: zone - the time zone to use, null is default Parameters: gregorianCutover - the cutover to use, null means default Parameters: minDaysInFirstWeek - minimum number of days in first week of the year; default is 4 |
getInstance | public static GJChronology getInstance(DateTimeZone zone, long gregorianCutover, int minDaysInFirstWeek)(Code) | | Factory method returns instances of the GJ cutover chronology. Any
cutover date may be specified.
Parameters: zone - the time zone to use, null is default Parameters: gregorianCutover - the cutover to use Parameters: minDaysInFirstWeek - minimum number of days in first week of the year; default is 4 |
getInstanceUTC | public static GJChronology getInstanceUTC()(Code) | | Factory method returns instances of the default GJ cutover
chronology. This uses a cutover date of October 15, 1582 (Gregorian)
00:00:00 UTC. For this value, October 4, 1582 (Julian) is followed by
October 15, 1582 (Gregorian).
The first day of the week is designated to be
org.joda.time.DateTimeConstants.MONDAY Monday ,
and the minimum days in the first week of the year is 4.
The time zone of the returned instance is UTC.
|
getMinimumDaysInFirstWeek | public int getMinimumDaysInFirstWeek()(Code) | | Gets the minimum days needed for a week to be the first week in a year.
the minimum days |
gregorianToJulianByWeekyear | long gregorianToJulianByWeekyear(long instant)(Code) | | |
gregorianToJulianByYear | long gregorianToJulianByYear(long instant)(Code) | | |
julianToGregorianByWeekyear | long julianToGregorianByWeekyear(long instant)(Code) | | |
julianToGregorianByYear | long julianToGregorianByYear(long instant)(Code) | | |
toString | public String toString()(Code) | | Gets a debugging toString.
a debugging string |
withUTC | public Chronology withUTC()(Code) | | Gets the Chronology in the UTC time zone.
the chronology in UTC |
withZone | public Chronology withZone(DateTimeZone zone)(Code) | | Gets the Chronology in a specific time zone.
Parameters: zone - the zone to get the chronology in, null is default the chronology |
Methods inherited from org.joda.time.chrono.AssembledChronology | abstract protected void assemble(Fields fields)(Code)(Java Doc) final public DurationField centuries()(Code)(Java Doc) final public DateTimeField centuryOfEra()(Code)(Java Doc) final public DateTimeField clockhourOfDay()(Code)(Java Doc) final public DateTimeField clockhourOfHalfday()(Code)(Java Doc) final public DateTimeField dayOfMonth()(Code)(Java Doc) final public DateTimeField dayOfWeek()(Code)(Java Doc) final public DateTimeField dayOfYear()(Code)(Java Doc) final public DurationField days()(Code)(Java Doc) final public DateTimeField era()(Code)(Java Doc) final public DurationField eras()(Code)(Java Doc) final protected Chronology getBase()(Code)(Java Doc) public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay) throws IllegalArgumentException(Code)(Java Doc) public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException(Code)(Java Doc) public long getDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException(Code)(Java Doc) final protected Object getParam()(Code)(Java Doc) public DateTimeZone getZone()(Code)(Java Doc) final public DateTimeField halfdayOfDay()(Code)(Java Doc) final public DurationField halfdays()(Code)(Java Doc) final public DateTimeField hourOfDay()(Code)(Java Doc) final public DateTimeField hourOfHalfday()(Code)(Java Doc) final public DurationField hours()(Code)(Java Doc) final public DurationField millis()(Code)(Java Doc) final public DateTimeField millisOfDay()(Code)(Java Doc) final public DateTimeField millisOfSecond()(Code)(Java Doc) final public DateTimeField minuteOfDay()(Code)(Java Doc) final public DateTimeField minuteOfHour()(Code)(Java Doc) final public DurationField minutes()(Code)(Java Doc) final public DateTimeField monthOfYear()(Code)(Java Doc) final public DurationField months()(Code)(Java Doc) final public DateTimeField secondOfDay()(Code)(Java Doc) final public DateTimeField secondOfMinute()(Code)(Java Doc) final public DurationField seconds()(Code)(Java Doc) final public DateTimeField weekOfWeekyear()(Code)(Java Doc) final public DurationField weeks()(Code)(Java Doc) final public DateTimeField weekyear()(Code)(Java Doc) final public DateTimeField weekyearOfCentury()(Code)(Java Doc) final public DurationField weekyears()(Code)(Java Doc) final public DateTimeField year()(Code)(Java Doc) final public DateTimeField yearOfCentury()(Code)(Java Doc) final public DateTimeField yearOfEra()(Code)(Java Doc) final public DurationField years()(Code)(Java Doc)
|
Methods inherited from org.joda.time.chrono.BaseChronology | public long add(ReadablePeriod period, long instant, int scalar)(Code)(Java Doc) public long add(long instant, long duration, int scalar)(Code)(Java Doc) public DurationField centuries()(Code)(Java Doc) public DateTimeField centuryOfEra()(Code)(Java Doc) public DateTimeField clockhourOfDay()(Code)(Java Doc) public DateTimeField clockhourOfHalfday()(Code)(Java Doc) public DateTimeField dayOfMonth()(Code)(Java Doc) public DateTimeField dayOfWeek()(Code)(Java Doc) public DateTimeField dayOfYear()(Code)(Java Doc) public DurationField days()(Code)(Java Doc) public DateTimeField era()(Code)(Java Doc) public DurationField eras()(Code)(Java Doc) public int[] get(ReadablePartial partial, long instant)(Code)(Java Doc) public int[] get(ReadablePeriod period, long startInstant, long endInstant)(Code)(Java Doc) public int[] get(ReadablePeriod period, long duration)(Code)(Java Doc) public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay) throws IllegalArgumentException(Code)(Java Doc) public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException(Code)(Java Doc) public long getDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException(Code)(Java Doc) abstract public DateTimeZone getZone()(Code)(Java Doc) public DateTimeField halfdayOfDay()(Code)(Java Doc) public DurationField halfdays()(Code)(Java Doc) public DateTimeField hourOfDay()(Code)(Java Doc) public DateTimeField hourOfHalfday()(Code)(Java Doc) public DurationField hours()(Code)(Java Doc) public DurationField millis()(Code)(Java Doc) public DateTimeField millisOfDay()(Code)(Java Doc) public DateTimeField millisOfSecond()(Code)(Java Doc) public DateTimeField minuteOfDay()(Code)(Java Doc) public DateTimeField minuteOfHour()(Code)(Java Doc) public DurationField minutes()(Code)(Java Doc) public DateTimeField monthOfYear()(Code)(Java Doc) public DurationField months()(Code)(Java Doc) public DateTimeField secondOfDay()(Code)(Java Doc) public DateTimeField secondOfMinute()(Code)(Java Doc) public DurationField seconds()(Code)(Java Doc) public long set(ReadablePartial partial, long instant)(Code)(Java Doc) abstract public String toString()(Code)(Java Doc) public void validate(ReadablePartial partial, int[] values)(Code)(Java Doc) public DateTimeField weekOfWeekyear()(Code)(Java Doc) public DurationField weeks()(Code)(Java Doc) public DateTimeField weekyear()(Code)(Java Doc) public DateTimeField weekyearOfCentury()(Code)(Java Doc) public DurationField weekyears()(Code)(Java Doc) abstract public Chronology withUTC()(Code)(Java Doc) abstract public Chronology withZone(DateTimeZone zone)(Code)(Java Doc) public DateTimeField year()(Code)(Java Doc) public DateTimeField yearOfCentury()(Code)(Java Doc) public DateTimeField yearOfEra()(Code)(Java Doc) public DurationField years()(Code)(Java Doc)
|
Methods inherited from org.joda.time.Chronology | abstract public long add(ReadablePeriod period, long instant, int scalar)(Code)(Java Doc) abstract public long add(long instant, long duration, int scalar)(Code)(Java Doc) abstract public DurationField centuries()(Code)(Java Doc) abstract public DateTimeField centuryOfEra()(Code)(Java Doc) abstract public DateTimeField clockhourOfDay()(Code)(Java Doc) abstract public DateTimeField clockhourOfHalfday()(Code)(Java Doc) abstract public DateTimeField dayOfMonth()(Code)(Java Doc) abstract public DateTimeField dayOfWeek()(Code)(Java Doc) abstract public DateTimeField dayOfYear()(Code)(Java Doc) abstract public DurationField days()(Code)(Java Doc) abstract public DateTimeField era()(Code)(Java Doc) abstract public DurationField eras()(Code)(Java Doc) abstract public int[] get(ReadablePartial partial, long instant)(Code)(Java Doc) abstract public int[] get(ReadablePeriod period, long startInstant, long endInstant)(Code)(Java Doc) abstract public int[] get(ReadablePeriod period, long duration)(Code)(Java Doc) public static Chronology getBuddhist()(Code)(Java Doc) public static Chronology getBuddhist(DateTimeZone zone)(Code)(Java Doc) public static Chronology getBuddhistUTC()(Code)(Java Doc) public static Chronology getCoptic()(Code)(Java Doc) public static Chronology getCoptic(DateTimeZone zone)(Code)(Java Doc) public static Chronology getCopticUTC()(Code)(Java Doc) abstract public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay)(Code)(Java Doc) abstract public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)(Code)(Java Doc) abstract public long getDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)(Code)(Java Doc) public static Chronology getGJ()(Code)(Java Doc) public static Chronology getGJ(DateTimeZone zone)(Code)(Java Doc) public static Chronology getGJUTC()(Code)(Java Doc) public static Chronology getGregorian()(Code)(Java Doc) public static Chronology getGregorian(DateTimeZone zone)(Code)(Java Doc) public static Chronology getGregorianUTC()(Code)(Java Doc) public static Chronology getISO()(Code)(Java Doc) public static Chronology getISO(DateTimeZone zone)(Code)(Java Doc) public static Chronology getISOUTC()(Code)(Java Doc) public static Chronology getJulian()(Code)(Java Doc) public static Chronology getJulian(DateTimeZone zone)(Code)(Java Doc) public static Chronology getJulianUTC()(Code)(Java Doc) abstract public DateTimeZone getZone()(Code)(Java Doc) abstract public DateTimeField halfdayOfDay()(Code)(Java Doc) abstract public DurationField halfdays()(Code)(Java Doc) abstract public DateTimeField hourOfDay()(Code)(Java Doc) abstract public DateTimeField hourOfHalfday()(Code)(Java Doc) abstract public DurationField hours()(Code)(Java Doc) abstract public DurationField millis()(Code)(Java Doc) abstract public DateTimeField millisOfDay()(Code)(Java Doc) abstract public DateTimeField millisOfSecond()(Code)(Java Doc) abstract public DateTimeField minuteOfDay()(Code)(Java Doc) abstract public DateTimeField minuteOfHour()(Code)(Java Doc) abstract public DurationField minutes()(Code)(Java Doc) abstract public DateTimeField monthOfYear()(Code)(Java Doc) abstract public DurationField months()(Code)(Java Doc) abstract public DateTimeField secondOfDay()(Code)(Java Doc) abstract public DateTimeField secondOfMinute()(Code)(Java Doc) abstract public DurationField seconds()(Code)(Java Doc) abstract public long set(ReadablePartial partial, long instant)(Code)(Java Doc) abstract public String toString()(Code)(Java Doc) abstract public void validate(ReadablePartial partial, int[] values)(Code)(Java Doc) abstract public DateTimeField weekOfWeekyear()(Code)(Java Doc) abstract public DurationField weeks()(Code)(Java Doc) abstract public DateTimeField weekyear()(Code)(Java Doc) abstract public DateTimeField weekyearOfCentury()(Code)(Java Doc) abstract public DurationField weekyears()(Code)(Java Doc) abstract public Chronology withUTC()(Code)(Java Doc) abstract public Chronology withZone(DateTimeZone zone)(Code)(Java Doc) abstract public DateTimeField year()(Code)(Java Doc) abstract public DateTimeField yearOfCentury()(Code)(Java Doc) abstract public DateTimeField yearOfEra()(Code)(Java Doc) abstract public DurationField years()(Code)(Java Doc)
|
|
|