Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.joda.time.Chronology
public abstract class Chronology
extends java.lang.Object
DateTime dt = new DateTime(CopticChronology.getInstance());The provided chronology implementations are:
Method Summary | |
abstract long |
|
abstract long |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract int[] |
|
abstract int[] |
|
abstract int[] |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
abstract long |
|
abstract long |
|
abstract long |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
static Chronology |
|
abstract DateTimeZone |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract long |
|
abstract String |
|
abstract void |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DurationField |
|
abstract Chronology |
|
abstract Chronology |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DateTimeField |
|
abstract DurationField |
|
public abstract long add(long instant, long duration, int scalar)
Adds the duration to the instant, specifying the number of times to add.
- Parameters:
instant
- the instant to add toduration
- the duration to addscalar
- the number of times to add
- Returns:
- the updated instant
public abstract long add(ReadablePeriod period, long instant, int scalar)
Adds the period to the instant, specifying the number of times to add.
- Parameters:
period
- the period to add, null means add nothinginstant
- the instant to add toscalar
- the number of times to add
- Returns:
- the updated instant
public abstract DurationField centuries()
Get the centuries duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField centuryOfEra()
Get the century of era field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField clockhourOfDay()
Get the hour of day (offset to 1-24) field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField clockhourOfHalfday()
Get the hour of am/pm (offset to 1-12) field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField dayOfMonth()
Get the day of month field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField dayOfWeek()
Get the day of week field for this chronology. DayOfWeek values are defined inDateTimeConstants
. They use the ISO definitions, where 1 is Monday and 7 is Sunday.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField dayOfYear()
Get the day of year field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField days()
Get the days duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField era()
Get the era field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField eras()
Get the eras duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract int[] get(ReadablePartial partial, long instant)
Gets the values of a partial from an instant.
- Parameters:
partial
- the partial instant to useinstant
- the instant to query
- Returns:
- the values of this partial extracted from the instant
public abstract int[] get(ReadablePeriod period, long duration)
Gets the values of a period from an interval.
- Parameters:
period
- the period instant to useduration
- the duration to query
- Returns:
- the values of the period extracted from the duration
public abstract int[] get(ReadablePeriod period, long startInstant, long endInstant)
Gets the values of a period from an interval.
- Parameters:
period
- the period instant to usestartInstant
- the start instant of an interval to queryendInstant
- the start instant of an interval to query
- Returns:
- the values of the period extracted from the interval
public static Chronology getBuddhist()
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.
- Returns:
- the Buddhist chronology
public static Chronology getBuddhist(DateTimeZone zone)
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.
- Parameters:
zone
- the zone to use, null means default zone
- Returns:
- the Buddhist chronology
public static Chronology getBuddhistUTC()
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.
- Returns:
- the Buddhist chronology
public static Chronology getCoptic()
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.
- Returns:
- the Coptic chronology
public static Chronology getCoptic(DateTimeZone zone)
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.
- Parameters:
zone
- the zone to use, null means default zone
- Returns:
- the Coptic chronology
public static Chronology getCopticUTC()
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:
- the Coptic chronology
public abstract long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay)
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.
- Parameters:
year
- year to usemonthOfYear
- month to usedayOfMonth
- day of month to usemillisOfDay
- millisecond to use
- Returns:
- millisecond instant from 1970-01-01T00:00:00Z
public abstract long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
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.
- Parameters:
year
- year to usemonthOfYear
- month to usedayOfMonth
- day of month to usehourOfDay
- hour to useminuteOfHour
- minute to usesecondOfMinute
- second to usemillisOfSecond
- millisecond to use
- Returns:
- millisecond instant from 1970-01-01T00:00:00Z
public abstract long getDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond)
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.
- Parameters:
instant
- instant to start fromhourOfDay
- hour to useminuteOfHour
- minute to usesecondOfMinute
- second to usemillisOfSecond
- millisecond to use
- Returns:
- millisecond instant from 1970-01-01T00:00:00Z
public static Chronology getGJ()
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 forGregorianCalendar
. The Gregorian calendar system is used after October 15, 1582, while the Julian calendar system is used before. UnlikeGregorianCalendar
, 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 onGJChronology
itself. When dealing solely with dates in the modern era, from 1600 onwards, we recommend using ISOChronology, which is the default.
- Returns:
- the GJ chronology
public static Chronology getGJ(DateTimeZone zone)
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 forGregorianCalendar
. The Gregorian calendar system is used after October 15, 1582, while the Julian calendar system is used before. UnlikeGregorianCalendar
, 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 onGJChronology
itself. When dealing solely with dates in the modern era, from 1600 onwards, we recommend using ISOChronology, which is the default.
- Parameters:
zone
- the zone to use, null means default zone
- Returns:
- the GJ chronology
public static Chronology getGJUTC()
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 forGregorianCalendar
. The Gregorian calendar system is used after October 15, 1582, while the Julian calendar system is used before. UnlikeGregorianCalendar
, 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 onGJChronology
itself. When dealing solely with dates in the modern era, from 1600 onwards, we recommend using ISOChronology, which is the default.
- Returns:
- the GJ chronology
public static Chronology getGregorian()
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 forGregorianCalendar
. For that purpose, you should usegetGJ()
. 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.
- Returns:
- the Gregorian chronology
public static Chronology getGregorian(DateTimeZone zone)
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 forGregorianCalendar
. For that purpose, you should usegetGJ()
. 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.
- Parameters:
zone
- the zone to use, null means default zone
- Returns:
- the Gregorian chronology
public static Chronology getGregorianUTC()
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 forGregorianCalendar
. For that purpose, you should usegetGJ()
. 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.
- Returns:
- the Gregorian chronology
public static Chronology getISO()
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.
- Returns:
- the ISO chronology
public static Chronology getISO(DateTimeZone zone)
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.
- Parameters:
zone
- the zone to use, null means default zone
- Returns:
- the ISO chronology
public static Chronology getISOUTC()
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.
- Returns:
- the ISO chronology
public static Chronology getJulian()
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.
- Returns:
- the Julian chronology
public static Chronology getJulian(DateTimeZone zone)
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.
- Parameters:
zone
- the zone to use, null means default zone
- Returns:
- the Julian chronology
public static Chronology getJulianUTC()
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 Julian chronology
public abstract DateTimeZone getZone()
Returns the DateTimeZone that this Chronology operates in, or null if unspecified.
- Returns:
- the DateTimeZone, null if unspecified
public abstract DateTimeField halfdayOfDay()
Get the AM(0) PM(1) field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField halfdays()
Get the halfdays duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField hourOfDay()
Get the hour of day (0-23) field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField hourOfHalfday()
Get the hour of am/pm (0-11) field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField hours()
Get the hours duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DurationField millis()
Get the millis duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField millisOfDay()
Get the millis of day field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField millisOfSecond()
Get the millis of second field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField minuteOfDay()
Get the minute of day field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField minuteOfHour()
Get the minute of hour field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField minutes()
Get the minutes duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField monthOfYear()
Get the month of year field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField months()
Get the months duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField secondOfDay()
Get the second of day field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField secondOfMinute()
Get the second of minute field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField seconds()
Get the seconds duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract long set(ReadablePartial partial, long instant)
Sets the partial into the instant.
- Parameters:
partial
- the partial instant to useinstant
- the instant to update
- Returns:
- the updated instant
public abstract String toString()
Gets a debugging toString.
- Returns:
- a debugging string
public abstract void validate(ReadablePartial partial, int[] values)
Validates whether the values are valid for the fields of a partial instant.
- Parameters:
partial
- the partial instant to validatevalues
- the values to validate, not null, match fields in partial
public abstract DateTimeField weekOfWeekyear()
Get the week of a week based year field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField weeks()
Get the weeks duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract DateTimeField weekyear()
Get the year of a week based year field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField weekyearOfCentury()
Get the year of a week based year in a century field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField weekyears()
Get the weekyears duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported
public abstract Chronology withUTC()
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:
- a version of this chronology that ignores time zones
public abstract Chronology withZone(DateTimeZone zone)
Returns an instance of this Chronology that operates in any time zone.
- Parameters:
zone
- to use, or default if null
- Returns:
- a version of this chronology with a specific time zone
- See Also:
ZonedChronology
public abstract DateTimeField year()
Get the year field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField yearOfCentury()
Get the year of century field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DateTimeField yearOfEra()
Get the year of era field for this chronology.
- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
public abstract DurationField years()
Get the years duration field for this chronology.
- Returns:
- DurationField or UnsupportedDurationField if unsupported