Package org.joda.time.chrono
Class ISOChronology
java.lang.Object
org.joda.time.Chronology
org.joda.time.chrono.BaseChronology
org.joda.time.chrono.AssembledChronology
org.joda.time.chrono.ISOChronology
- All Implemented Interfaces:
Serializable
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.
- Since:
- 1.0
- Author:
- Stephen Colebourne, Brian S O'Neill
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.joda.time.chrono.AssembledChronology
AssembledChronology.Fields
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assemble
(AssembledChronology.Fields fields) Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields.boolean
Checks if this chronology instance equals another.static ISOChronology
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
Gets an instance of the ISOChronology.int
hashCode()
A suitable hash code for the chronology.toString()
Gets a debugging toString.withUTC()
Gets the Chronology in the UTC time zone.withZone
(DateTimeZone zone) Gets the Chronology in a specific time zone.Methods inherited from class org.joda.time.chrono.AssembledChronology
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
-
Method Details
-
getInstanceUTC
Gets an instance of the ISOChronology. The time zone of the returned instance is UTC.- Returns:
- a singleton UTC instance of the chronology
-
getInstance
Gets an instance of the ISOChronology in the default time zone.- Returns:
- a chronology in the default time zone
-
getInstance
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
-
withUTC
Gets the Chronology in the UTC time zone.- Specified by:
withUTC
in classBaseChronology
- Returns:
- the chronology in UTC
-
withZone
Gets the Chronology in a specific time zone.- Specified by:
withZone
in classBaseChronology
- Parameters:
zone
- the zone to get the chronology in, null is default- Returns:
- the chronology
- See Also:
-
toString
Gets a debugging toString.- Specified by:
toString
in classBaseChronology
- Returns:
- a debugging string
-
assemble
Description copied from class:AssembledChronology
Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields. All unset fields default to unsupported instances.- Specified by:
assemble
in classAssembledChronology
- Parameters:
fields
- container of fields
-
equals
Checks if this chronology instance equals another. -
hashCode
public int hashCode()A suitable hash code for the chronology.
-