org.joda.time.chrono

Class ISOChronology

Implemented Interfaces:
Serializable

public final class ISOChronology
extends AssembledChronology

Implements a chronology that follows the rules of the ISO8601 standard, which is compatible with Gregorian for all modern dates. When ISO does not define a field, but it can be determined (such as AM/PM) it is included.

With the exception of century related fields, ISOChronology is exactly the same as GregorianChronology. In this chronology, centuries and year of century are zero based. For all years, the century is determined by dropping the last two digits of the year, ignoring sign. The year of century is the value of the last two year digits.

ISOChronology is thread-safe and immutable.

Authors:
Stephen Colebourne
Brian S O'Neill
Since:
1.0

Nested Class Summary

Nested classes/interfaces inherited from class org.joda.time.chrono.AssembledChronology

AssembledChronology.Fields

Method Summary

protected void
assemble(AssembledChronology.Fields fields)
boolean
equals(Object obj)
Checks if this chronology instance equals another.
static ISOChronology
getInstance()
Gets an instance of the ISOChronology in the default time zone.
static ISOChronology
getInstance(DateTimeZone zone)
Gets an instance of the ISOChronology in the given time zone.
static ISOChronology
getInstanceUTC()
Gets an instance of the ISOChronology.
int
hashCode()
A suitable hash code for the chronology.
String
toString()
Gets a debugging toString.
Chronology
withUTC()
Gets the Chronology in the UTC time zone.
Chronology
withZone(DateTimeZone zone)
Gets the Chronology in a specific time zone.

Methods inherited from class org.joda.time.chrono.AssembledChronology

assemble, centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, getBase, getDateTimeMillis, getDateTimeMillis, getDateTimeMillis, getParam, getZone, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, year, yearOfCentury, yearOfEra, years

Methods inherited from class org.joda.time.chrono.BaseChronology

add, add, centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, get, get, get, getDateTimeMillis, getDateTimeMillis, getDateTimeMillis, getZone, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, set, toString, validate, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, withUTC, withZone, year, yearOfCentury, yearOfEra, years

Methods inherited from class org.joda.time.Chronology

add, add, centuries, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, get, get, get, getBuddhist, getBuddhist, getBuddhistUTC, getCoptic, getCoptic, getCopticUTC, getDateTimeMillis, getDateTimeMillis, getDateTimeMillis, getGJ, getGJ, getGJUTC, getGregorian, getGregorian, getGregorianUTC, getISO, getISO, getISOUTC, getJulian, getJulian, getJulianUTC, getZone, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, set, toString, validate, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, withUTC, withZone, year, yearOfCentury, yearOfEra, years

Method Details

assemble

protected void assemble(AssembledChronology.Fields fields)
Overrides:
assemble in interface AssembledChronology

equals

public boolean equals(Object obj)
Checks if this chronology instance equals another.
Parameters:
obj - the object to compare to
Returns:
true if equal
Since:
1.6

getInstance

public static ISOChronology getInstance()
Gets an instance of the ISOChronology in the default time zone.
Returns:
a chronology in the default time zone

getInstance

public static ISOChronology getInstance(DateTimeZone zone)
Gets an instance of the ISOChronology in the given time zone.
Parameters:
zone - the time zone to get the chronology in, null is default
Returns:
a chronology in the specified time zone

getInstanceUTC

public static ISOChronology getInstanceUTC()
Gets an instance of the ISOChronology. The time zone of the returned instance is UTC.
Returns:
a singleton UTC instance of the chronology

hashCode

public int hashCode()
A suitable hash code for the chronology.
Returns:
the hash code
Since:
1.6

toString

public String toString()
Gets a debugging toString.
Overrides:
toString in interface BaseChronology
Returns:
a debugging string

withUTC

public Chronology withUTC()
Gets the Chronology in the UTC time zone.
Overrides:
withUTC in interface BaseChronology
Returns:
the chronology in UTC

withZone

public Chronology withZone(DateTimeZone zone)
Gets the Chronology in a specific time zone.
Overrides:
withZone in interface BaseChronology
Parameters:
zone - the zone to get the chronology in, null is default
Returns:
the chronology

Copyright (c) 2001-2006 - Joda.org