|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.joda.time.Chronology
|
+--org.joda.time.chrono.gj.GJChronology
GJChronology provides access to the individual date time fields for the Gregorian/Julian defined chronological calendar system.
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 March 1, 4 CE, Julian leap years were irregular, and before 45 BCE there was no Julian calendar.
This chronology differs from java.util.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 implemented by this class has a year zero.
A pure proleptic Gregorian chronology is obtained by specifying a cutover of Long.MIN_VALUE. Likewise, a pure Julian chronology is obtained with a cutover of Long.MAX_VALUE.
| Method Summary | |
DateTimeField |
centuryOfEra()
Get the century of era field for this chronology. |
DateTimeField |
clockhourOfDay()
Get the hour of day (offset to 1-24) field for this chronology. |
DateTimeField |
clockhourOfHalfday()
Get the hour of am/pm (offset to 1-12) field for this chronology. |
DateTimeField |
dayOfMonth()
Get the day of month field for this chronology. |
DateTimeField |
dayOfWeek()
Get the day of week field for this chronology. |
DateTimeField |
dayOfYear()
Get the day of year field for this chronology. |
DateTimeField |
era()
Get the era field for this chronology. |
DateTimeZone |
getDateTimeZone()
Returns the DateTimeZone that this Chronology operates in, or null if unspecified. |
Instant |
getGregorianJulianCutover()
Gets the cutover instant between Gregorian and Julian chronologies. |
abstract long |
getGregorianJulianCutoverMillis()
Gets the cutover millis between Gregorian and Julian chronologies. |
static GJChronology |
getInstance()
Factory method returns instances of the default GJ chronology. |
static GJChronology |
getInstance(DateTimeZone zone)
Factory method returns instances of the default GJ chronology. |
static GJChronology |
getInstance(DateTimeZone zone,
long gregorianCutover,
boolean centuryISO)
Factory method allowing the Gregorian cutover point and year zero handling to be set. |
static GJChronology |
getInstance(DateTimeZone zone,
long gregorianCutover,
boolean centuryISO,
int minDaysInFirstWeek)
Factory method allowing the Gregorian cutover point and year zero handling to be set. |
static GJChronology |
getInstance(DateTimeZone zone,
ReadableInstant gregorianCutover,
boolean centuryISO)
Factory method allowing the Gregorian cutover point and year zero handling to be set. |
static GJChronology |
getInstance(DateTimeZone zone,
ReadableInstant gregorianCutover,
boolean centuryISO,
int minDaysInFirstWeek)
Factory method allowing the Gregorian cutover point and year zero handling to be set. |
static GJChronology |
getInstanceUTC()
Factory method returns instances of the default GJ chronology. |
abstract int |
getMinimumDaysInFirstWeek()
|
DateTimeField |
halfdayOfDay()
Get the AM(0) PM(1) field for this chronology. |
DateTimeField |
hourOfDay()
Get the hour of day (0-23) field for this chronology. |
DateTimeField |
hourOfHalfday()
Get the hour of am/pm (0-11) field for this chronology. |
abstract boolean |
isCenturyISO()
Returns true when century fields follow ISO rules. |
DateTimeField |
millisOfDay()
Get the millis of day field for this chronology. |
DateTimeField |
millisOfSecond()
Get the millis of second field for this chronology. |
DateTimeField |
minuteOfDay()
Get the minute of day field for this chronology. |
DateTimeField |
minuteOfHour()
Get the minute of hour field for this chronology. |
DateTimeField |
monthOfYear()
Get the month of year field for this chronology. |
DateTimeField |
secondOfDay()
Get the second of day field for this chronology. |
DateTimeField |
secondOfMinute()
Get the second of minute field for this chronology. |
DateTimeField |
weekOfWeekyear()
Get the week of a week based year field for this chronology. |
DateTimeField |
weekyear()
Get the year of a week based year field for this chronology. |
Chronology |
withDateTimeZone(DateTimeZone zone)
Returns an instance of this Chronology that operates in any time zone. |
DateTimeField |
year()
Get the year field for this chronology. |
DateTimeField |
yearOfCentury()
Get the year of century field for this chronology. |
DateTimeField |
yearOfEra()
Get the year of era field for this chronology. |
| Methods inherited from class org.joda.time.Chronology |
getDateOnlyMillis, getTimeOnlyMillis, withUTC |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static GJChronology getInstanceUTC()
The first day of the week is designated to be
Monday, and the minimum days in the
first week of the year is 4.
The time zone of the returned instance is UTC.
public static GJChronology getInstance()
The first day of the week is designated to be
Monday, and the minimum days in the
first week of the year is 4.
The returned chronology is in the default time zone.
public static GJChronology getInstance(DateTimeZone zone)
The first day of the week is designated to be
Monday, and the minimum days in the
first week of the year is 4.
zone - the time zone to use, null is default
public static GJChronology getInstance(DateTimeZone zone,
ReadableInstant gregorianCutover,
boolean centuryISO)
The first day of the week is designated to be
Monday, and the minimum days in the
first week of the year is 4.
zone - the time zone to use, null is defaultgregorianCutover - the cutover as a ReadableInstant, null means defaultcenturyISO - when true, century related fields follow ISO rules
public static GJChronology getInstance(DateTimeZone zone,
long gregorianCutover,
boolean centuryISO)
The first day of the week is designated to be
Monday, and the minimum days in the
first week of the year is 4.
zone - the time zone to use, null is defaultgregorianCutover - the cutover as milliseconds from 1970-01-01T00:00:00ZcenturyISO - when true, century related fields follow ISO rules
public static GJChronology getInstance(DateTimeZone zone,
ReadableInstant gregorianCutover,
boolean centuryISO,
int minDaysInFirstWeek)
zone - the time zone to use, null is defaultgregorianCutover - the cutover as a ReadableInstant, null means defaultcenturyISO - when true, century related fields follow ISO rulesminDaysInFirstWeek - minimum number of days in first week of the year; ISO is 4
public static GJChronology getInstance(DateTimeZone zone,
long gregorianCutover,
boolean centuryISO,
int minDaysInFirstWeek)
zone - the time zone to use, null is defaultgregorianCutover - the cutover as milliseconds from 1970-01-01T00:00:00ZcenturyISO - when true, century related fields follow ISO rulesminDaysInFirstWeek - minimum number of days in first week of the year; ISO is 4public Chronology withDateTimeZone(DateTimeZone zone)
Chronology
withDateTimeZone in class ChronologyZonedChronologypublic DateTimeZone getDateTimeZone()
Chronology
getDateTimeZone in class Chronologypublic Instant getGregorianJulianCutover()
public abstract long getGregorianJulianCutoverMillis()
public abstract boolean isCenturyISO()
When false is returned, the first century is defined to start on year one, and the year of century can range from 1 to 100.
public abstract int getMinimumDaysInFirstWeek()
public DateTimeField millisOfSecond()
Chronology
millisOfSecond in class Chronologypublic DateTimeField millisOfDay()
Chronology
millisOfDay in class Chronologypublic DateTimeField secondOfMinute()
Chronology
secondOfMinute in class Chronologypublic DateTimeField secondOfDay()
Chronology
secondOfDay in class Chronologypublic DateTimeField minuteOfHour()
Chronology
minuteOfHour in class Chronologypublic DateTimeField minuteOfDay()
Chronology
minuteOfDay in class Chronologypublic DateTimeField hourOfDay()
Chronology
hourOfDay in class Chronologypublic DateTimeField clockhourOfDay()
Chronology
clockhourOfDay in class Chronologypublic DateTimeField hourOfHalfday()
Chronology
hourOfHalfday in class Chronologypublic DateTimeField clockhourOfHalfday()
Chronology
clockhourOfHalfday in class Chronologypublic DateTimeField halfdayOfDay()
Chronology
halfdayOfDay in class Chronologypublic DateTimeField dayOfWeek()
ChronologyDayOfWeek values are defined in DateTimeConstants.
They use the ISO definitions, where 1 is Monday and 7 is Sunday.
dayOfWeek in class Chronologypublic DateTimeField dayOfMonth()
Chronology
dayOfMonth in class Chronologypublic DateTimeField dayOfYear()
Chronology
dayOfYear in class Chronologypublic DateTimeField weekOfWeekyear()
Chronology
weekOfWeekyear in class Chronologypublic DateTimeField weekyear()
Chronology
weekyear in class Chronologypublic DateTimeField monthOfYear()
Chronology
monthOfYear in class Chronologypublic DateTimeField year()
Chronology
year in class Chronologypublic DateTimeField yearOfEra()
Chronology
yearOfEra in class Chronologypublic DateTimeField yearOfCentury()
Chronology
yearOfCentury in class Chronologypublic DateTimeField centuryOfEra()
Chronology
centuryOfEra in class Chronologypublic DateTimeField era()
Chronology
era in class Chronology
|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||