java.lang.Object | |
↳ | org.joda.time.Chronology |
Known Direct Subclasses |
Known Indirect Subclasses |
Chronology provides access to the individual date time fields for a chronological calendar system.
Various chronologies are supported by subclasses including ISO and GregorianJulian. To construct a Chronology you should use the factory methods on the chronology subclass in the chrono package.
For example, to obtain the current time in the coptic calendar system:
DateTime dt = new DateTime(CopticChronology.getInstance());
The provided chronology implementations are:
This class defines a number of fields with names from the ISO8601 standard. It does not 'strongly' define these fields however, thus implementations are free to interpret the field names as they wish. For example, a week could be defined as 10 days and a month as 40 days in a special WeirdChronology implementation. Clearly the GJ and ISO implementations provided use the field names as you would expect.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds the period to the instant, specifying the number of times to add.
| |||||||||||
Adds the duration to the instant, specifying the number of times to add.
| |||||||||||
Get the centuries duration field for this chronology.
| |||||||||||
Get the century of era field for this chronology.
| |||||||||||
Get the hour of day (offset to 1-24) field for this chronology.
| |||||||||||
Get the hour of am/pm (offset to 1-12) field for this chronology.
| |||||||||||
Get the day of month field for this chronology.
| |||||||||||
Get the day of week field for this chronology.
| |||||||||||
Get the day of year field for this chronology.
| |||||||||||
Get the days duration field for this chronology.
| |||||||||||
Get the era field for this chronology.
| |||||||||||
Get the eras duration field for this chronology.
| |||||||||||
Gets the values of a period from an interval.
| |||||||||||
Gets the values of a partial from an instant.
| |||||||||||
Gets the values of a period from an interval.
| |||||||||||
This method is deprecated.
Use BuddhistChronology.getInstance()
| |||||||||||
This method is deprecated.
Use BuddhistChronology.getInstance(zone)
| |||||||||||
This method is deprecated.
Use BuddhistChronology.getInstanceUTC()
| |||||||||||
This method is deprecated.
Use CopticChronology.getInstance(zone)
| |||||||||||
This method is deprecated.
Use CopticChronology.getInstance()
| |||||||||||
This method is deprecated.
Use CopticChronology.getInstanceUTC()
| |||||||||||
Returns a datetime millisecond instant, from from the given instant,
hour, minute, second, and millisecond values.
| |||||||||||
Returns a datetime millisecond instant, formed from the given year,
month, day, and millisecond values.
| |||||||||||
Returns a datetime millisecond instant, formed from the given year,
month, day, hour, minute, second, and millisecond values.
| |||||||||||
This method is deprecated.
Use GJChronology.getInstance(zone)
| |||||||||||
This method is deprecated.
Use GJChronology.getInstance()
| |||||||||||
This method is deprecated.
Use GJChronology.getInstanceUTC()
| |||||||||||
This method is deprecated.
Use GregorianChronology.getInstance()
| |||||||||||
This method is deprecated.
Use GregorianChronology.getInstance(zone)
| |||||||||||
This method is deprecated.
Use GregorianChronology.getInstanceUTC()
| |||||||||||
This method is deprecated.
Use ISOChronology.getInstance(zone)
| |||||||||||
This method is deprecated.
Use ISOChronology.getInstance()
| |||||||||||
This method is deprecated.
Use ISOChronology.getInstanceUTC()
| |||||||||||
This method is deprecated.
Use JulianChronology.getInstance(zone)
| |||||||||||
This method is deprecated.
Use JulianChronology.getInstance()
| |||||||||||
This method is deprecated.
Use JulianChronology.getInstanceUTC()
| |||||||||||
Returns the DateTimeZone that this Chronology operates in, or null if
unspecified.
| |||||||||||
Get the AM(0) PM(1) field for this chronology.
| |||||||||||
Get the halfdays duration field for this chronology.
| |||||||||||
Get the hour of day (0-23) field for this chronology.
| |||||||||||
Get the hour of am/pm (0-11) field for this chronology.
| |||||||||||
Get the hours duration field for this chronology.
| |||||||||||
Get the millis duration field for this chronology.
| |||||||||||
Get the millis of day field for this chronology.
| |||||||||||
Get the millis of second field for this chronology.
| |||||||||||
Get the minute of day field for this chronology.
| |||||||||||
Get the minute of hour field for this chronology.
| |||||||||||
Get the minutes duration field for this chronology.
| |||||||||||
Get the month of year field for this chronology.
| |||||||||||
Get the months duration field for this chronology.
| |||||||||||
Get the second of day field for this chronology.
| |||||||||||
Get the second of minute field for this chronology.
| |||||||||||
Get the seconds duration field for this chronology.
| |||||||||||
Sets the partial into the instant.
| |||||||||||
Gets a debugging toString.
| |||||||||||
Validates whether the values are valid for the fields of a partial instant.
| |||||||||||
Get the week of a week based year field for this chronology.
| |||||||||||
Get the weeks duration field for this chronology.
| |||||||||||
Get the year of a week based year field for this chronology.
| |||||||||||
Get the year of a week based year in a century field for this chronology.
| |||||||||||
Get the weekyears duration field for this chronology.
| |||||||||||
Returns an instance of this Chronology that operates in the UTC time
zone.
| |||||||||||
Returns an instance of this Chronology that operates in any time zone.
| |||||||||||
Get the year field for this chronology.
| |||||||||||
Get the year of century field for this chronology.
| |||||||||||
Get the year of era field for this chronology.
| |||||||||||
Get the years duration field for this chronology.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Adds the period to the instant, specifying the number of times to add.
period | the period to add, null means add nothing |
---|---|
instant | the instant to add to |
scalar | the number of times to add |
Adds the duration to the instant, specifying the number of times to add.
instant | the instant to add to |
---|---|
duration | the duration to add |
scalar | the number of times to add |
Get the centuries duration field for this chronology.
Get the century of era field for this chronology.
Get the hour of day (offset to 1-24) field for this chronology.
Get the hour of am/pm (offset to 1-12) field for this chronology.
Get the day of month field for this chronology.
Get the day of week field for this chronology.
DayOfWeek values are defined in DateTimeConstants
.
They use the ISO definitions, where 1 is Monday and 7 is Sunday.
Get the day of year field for this chronology.
Get the days duration field for this chronology.
Get the era field for this chronology.
Get the eras duration field for this chronology.
Gets the values of a period from an interval.
period | the period instant to use |
---|---|
startInstant | the start instant of an interval to query |
endInstant | the start instant of an interval to query |
Gets the values of a partial from an instant.
partial | the partial instant to use |
---|---|
instant | the instant to query |
Gets the values of a period from an interval.
period | the period instant to use |
---|---|
duration | the duration to query |
This method is deprecated.
Use BuddhistChronology.getInstance()
Gets an instance of the BuddhistChronology in the default zone.
BuddhistChronology
defines all fields using standard meanings,
however the year is offset by 543. The chronology cannot be used before
year 1 in the Buddhist calendar.
This method is deprecated.
Use BuddhistChronology.getInstance(zone)
Gets an instance of the BuddhistChronology in the specified zone.
BuddhistChronology
defines all fields using standard meanings,
however the year is offset by 543. The chronology cannot be used before
year 1 in the Buddhist calendar.
zone | the zone to use, null means default zone |
---|
This method is deprecated.
Use BuddhistChronology.getInstanceUTC()
Gets an instance of the BuddhistChronology in the UTC zone.
BuddhistChronology
defines all fields using standard meanings,
however the year is offset by 543. The chronology cannot be used before
year 1 in the Buddhist calendar.
This method is deprecated.
Use CopticChronology.getInstance(zone)
Gets an instance of the CopticChronology in the specified zone.
CopticChronology
defines fields sensibly for the Coptic calendar system.
The Coptic calendar system defines every fourth year as leap.
The year is broken down into 12 months, each 30 days in length.
An extra period at the end of the year is either 5 or 6 days in length
and is returned as a 13th month.
Year 1 in the Coptic calendar began on August 29, 284 CE (Julian).
The chronology cannot be used before the first Coptic year.
zone | the zone to use, null means default zone |
---|
This method is deprecated.
Use CopticChronology.getInstance()
Gets an instance of the CopticChronology in the default zone.
CopticChronology
defines fields sensibly for the Coptic calendar system.
The Coptic calendar system defines every fourth year as leap.
The year is broken down into 12 months, each 30 days in length.
An extra period at the end of the year is either 5 or 6 days in length
and is returned as a 13th month.
Year 1 in the Coptic calendar began on August 29, 284 CE (Julian).
The chronology cannot be used before the first Coptic year.
This method is deprecated.
Use CopticChronology.getInstanceUTC()
Gets an instance of the CopticChronology in the UTC zone.
CopticChronology
defines fields sensibly for the Coptic calendar system.
The Coptic calendar system defines every fourth year as leap.
The year is broken down into 12 months, each 30 days in length.
An extra period at the end of the year is either 5 or 6 days in length
and is returned as a 13th month.
Year 1 in the Coptic calendar began on August 29, 284 CE (Julian).
The chronology cannot be used before the first Coptic year.
Returns a datetime millisecond instant, from from the given instant, hour, minute, second, and millisecond values. The set of given values must refer to a valid datetime, or else an IllegalArgumentException is thrown.
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
instant | instant to start from |
---|---|
hourOfDay | hour to use |
minuteOfHour | minute to use |
secondOfMinute | second to use |
millisOfSecond | millisecond to use |
IllegalArgumentException | if the values are invalid |
---|
Returns a datetime millisecond instant, formed from the given year, month, day, and millisecond values. The set of given values must refer to a valid datetime, or else an IllegalArgumentException is thrown.
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
year | year to use |
---|---|
monthOfYear | month to use |
dayOfMonth | day of month to use |
millisOfDay | millisecond to use |
IllegalArgumentException | if the values are invalid |
---|
Returns a datetime millisecond instant, formed from the given year, month, day, hour, minute, second, and millisecond values. The set of given values must refer to a valid datetime, or else an IllegalArgumentException is thrown.
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
year | year to use |
---|---|
monthOfYear | month to use |
dayOfMonth | day of month to use |
hourOfDay | hour to use |
minuteOfHour | minute to use |
secondOfMinute | second to use |
millisOfSecond | millisecond to use |
IllegalArgumentException | if the values are invalid |
---|
This method is deprecated.
Use GJChronology.getInstance(zone)
Gets an instance of the GJChronology in the specified zone.
GJChronology
defines all fields using standard meanings.
This chronology is intended to be used as a replacement for GregorianCalendar
.
The Gregorian calendar system is used after October 15, 1582, while the
Julian calendar system is used before.
Unlike GregorianCalendar
, this chronology returns a year of -1
for 1 BCE, -2 for 2 BCE and so on. Thus there is no year zero.
This method uses the standard Julian to Gregorian cutover date of
October 15th 1582. If you require a cutover on a different date, then use
the factories on GJChronology
itself.
When dealing solely with dates in the modern era, from 1600 onwards, we recommend using ISOChronology, which is the default.
zone | the zone to use, null means default zone |
---|
This method is deprecated.
Use GJChronology.getInstance()
Gets an instance of the GJChronology in the default zone.
GJChronology
defines all fields using standard meanings.
This chronology is intended to be used as a replacement for GregorianCalendar
.
The Gregorian calendar system is used after October 15, 1582, while the
Julian calendar system is used before.
Unlike GregorianCalendar
, this chronology returns a year of -1
for 1 BCE, -2 for 2 BCE and so on. Thus there is no year zero.
This method uses the standard Julian to Gregorian cutover date of
October 15th 1582. If you require a cutover on a different date, then use
the factories on GJChronology
itself.
When dealing solely with dates in the modern era, from 1600 onwards, we recommend using ISOChronology, which is the default.
This method is deprecated.
Use GJChronology.getInstanceUTC()
Gets an instance of the GJChronology in the UTC zone.
GJChronology
defines all fields using standard meanings.
This chronology is intended to be used as a replacement for GregorianCalendar
.
The Gregorian calendar system is used after October 15, 1582, while the
Julian calendar system is used before.
Unlike GregorianCalendar
, this chronology returns a year of -1
for 1 BCE, -2 for 2 BCE and so on. Thus there is no year zero.
This method uses the standard Julian to Gregorian cutover date of
October 15th 1582. If you require a cutover on a different date, then use
the factories on GJChronology
itself.
When dealing solely with dates in the modern era, from 1600 onwards, we recommend using ISOChronology, which is the default.
This method is deprecated.
Use GregorianChronology.getInstance()
Gets an instance of the GregorianChronology in the default zone.
GregorianChronology
defines all fields using standard meanings.
It uses the Gregorian calendar rules for all time (proleptic)
thus it is NOT a replacement for GregorianCalendar
.
For that purpose, you should use getGJ()
.
The Gregorian calendar system defines a leap year every four years, except that every 100 years is not leap, but every 400 is leap.
Technically, this chronology is almost identical to the ISO chronology, thus we recommend using ISOChronology instead, which is the default.
This method is deprecated.
Use GregorianChronology.getInstance(zone)
Gets an instance of the GregorianChronology in the specified zone.
GregorianChronology
defines all fields using standard meanings.
It uses the Gregorian calendar rules for all time (proleptic)
thus it is NOT a replacement for GregorianCalendar
.
For that purpose, you should use getGJ()
.
The Gregorian calendar system defines a leap year every four years, except that every 100 years is not leap, but every 400 is leap.
Technically, this chronology is almost identical to the ISO chronology, thus we recommend using ISOChronology instead, which is the default.
zone | the zone to use, null means default zone |
---|
This method is deprecated.
Use GregorianChronology.getInstanceUTC()
Gets an instance of the GregorianChronology in the UTC zone.
GregorianChronology
defines all fields using standard meanings.
It uses the Gregorian calendar rules for all time (proleptic)
thus it is NOT a replacement for GregorianCalendar
.
For that purpose, you should use getGJ()
.
The Gregorian calendar system defines a leap year every four years, except that every 100 years is not leap, but every 400 is leap.
Technically, this chronology is almost identical to the ISO chronology, thus we recommend using ISOChronology instead, which is the default.
This method is deprecated.
Use ISOChronology.getInstance(zone)
Gets an instance of the ISOChronology in the specified zone.
ISOChronology
defines all fields in line with the ISO8601 standard.
This chronology is the default, and is suitable for all normal datetime processing.
It is unsuitable for historical datetimes before October 15, 1582
as it applies the modern Gregorian calendar rules before that date.
zone | the zone to use, null means default zone |
---|
This method is deprecated.
Use ISOChronology.getInstance()
Gets an instance of the ISOChronology in the default zone.
ISOChronology
defines all fields in line with the ISO8601 standard.
This chronology is the default, and is suitable for all normal datetime processing.
It is unsuitable for historical datetimes before October 15, 1582
as it applies the modern Gregorian calendar rules before that date.
This method is deprecated.
Use ISOChronology.getInstanceUTC()
Gets an instance of the ISOChronology in the UTC zone.
ISOChronology
defines all fields in line with the ISO8601 standard.
This chronology is the default, and is suitable for all normal datetime processing.
It is unsuitable for historical datetimes before October 15, 1582
as it applies the modern Gregorian calendar rules before that date.
This method is deprecated.
Use JulianChronology.getInstance(zone)
Gets an instance of the JulianChronology in the specified zone.
JulianChronology
defines all fields using standard meanings.
It uses the Julian calendar rules for all time (proleptic).
The Julian calendar system defines a leap year every four years.
zone | the zone to use, null means default zone |
---|
This method is deprecated.
Use JulianChronology.getInstance()
Gets an instance of the JulianChronology in the default zone.
JulianChronology
defines all fields using standard meanings.
It uses the Julian calendar rules for all time (proleptic).
The Julian calendar system defines a leap year every four years.
This method is deprecated.
Use JulianChronology.getInstanceUTC()
Gets an instance of the JulianChronology in the UTC zone.
JulianChronology
defines all fields using standard meanings.
It uses the Julian calendar rules for all time (proleptic).
The Julian calendar system defines a leap year every four years.
Returns the DateTimeZone that this Chronology operates in, or null if unspecified.
Get the AM(0) PM(1) field for this chronology.
Get the halfdays duration field for this chronology.
Get the hour of day (0-23) field for this chronology.
Get the hour of am/pm (0-11) field for this chronology.
Get the hours duration field for this chronology.
Get the millis duration field for this chronology.
Get the millis of day field for this chronology.
Get the millis of second field for this chronology.
Get the minute of day field for this chronology.
Get the minute of hour field for this chronology.
Get the minutes duration field for this chronology.
Get the month of year field for this chronology.
Get the months duration field for this chronology.
Get the second of day field for this chronology.
Get the second of minute field for this chronology.
Get the seconds duration field for this chronology.
Sets the partial into the instant.
partial | the partial instant to use |
---|---|
instant | the instant to update |
Validates whether the values are valid for the fields of a partial instant.
partial | the partial instant to validate |
---|---|
values | the values to validate, not null, match fields in partial |
IllegalArgumentException | if the instant is invalid |
---|
Get the week of a week based year field for this chronology.
Get the weeks duration field for this chronology.
Get the year of a week based year field for this chronology.
Get the year of a week based year in a century field for this chronology.
Get the weekyears duration field for this chronology.
Returns an instance of this Chronology that operates in the UTC time zone. Chronologies that do not operate in a time zone or are already UTC must return themself.
Returns an instance of this Chronology that operates in any time zone.
zone | to use, or default if null |
---|
Get the year field for this chronology.
Get the year of century field for this chronology.
Get the year of era field for this chronology.
Get the years duration field for this chronology.