# ChronoUnit

public final enum **ChronoUnit** extends [Enum](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html)\<[ChronoUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/ChronoUnit.html)\>  
implements [TemporalUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html) A standard set of date periods units.


This set of units provide unit-based access to manipulate a date, time or date-time.
The standard set of units can be extended by implementing `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html`.


These units are intended to be applicable in multiple calendar systems.
For example, most non-ISO calendar systems define units of years, months and days,
just with slightly different rules.
The documentation of each unit explains how it operates.

### Inherited Method Summary

From class [java.lang.Enum](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html)

|---|---|
| final [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#clone())() Throws CloneNotSupportedException. |
| final int | [compareTo](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#compareTo(E))([ChronoUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/ChronoUnit.html) o) Compares this enum with the specified object for order. |
| final boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) other) Returns true if the specified object is equal to this enum constant. |
| final void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#finalize())() enum classes cannot have finalize methods. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<[ChronoUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/ChronoUnit.html)\> | [getDeclaringClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#getDeclaringClass())() Returns the Class object corresponding to this enum constant's enum type. |
| final int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#hashCode())() Returns a hash code for this enum constant. |
| final [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [name](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#name())() Returns the name of this enum constant, exactly as declared in its enum declaration. |
| final int | [ordinal](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#ordinal())() Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero). |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#toString())() Returns the name of this enum constant, as contained in the declaration. |
| static \<T extends [Enum](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html)\<T\>\> T | [valueOf](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Enum.html#valueOf(java.lang.Class<T>,%20java.lang.String))([Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<T\> enumType, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Returns the enum constant of the specified enum type with the specified name. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [java.lang.Comparable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Comparable.html)

|---|---|
| abstract int | [compareTo](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Comparable.html#compareTo(T))([ChronoUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/ChronoUnit.html) o) Compares this object with the specified object for order. |

From interface [java.time.temporal.TemporalUnit](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html)

|---|---|
| abstract \<R extends [Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html)\> R | [addTo](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#addTo(R,%20long))(R temporal, long amount) Returns a copy of the specified temporal object with the specified period added. |
| abstract long | [between](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#between(java.time.temporal.Temporal,%20java.time.temporal.Temporal))([Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html) temporal1Inclusive, [Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html) temporal2Exclusive) Calculates the amount of time between two temporal objects. |
| abstract [Duration](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/Duration.html) | [getDuration](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#getDuration())() Gets the duration of this unit, which may be an estimate. |
| abstract boolean | [isDateBased](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#isDateBased())() Checks if this unit represents a component of a date. |
| abstract boolean | [isDurationEstimated](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#isDurationEstimated())() Checks if the duration of the unit is an estimate. |
| boolean | [isSupportedBy](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#isSupportedBy(java.time.temporal.Temporal))([Temporal](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/Temporal.html) temporal) Checks if this unit is supported by the specified temporal object. |
| abstract boolean | [isTimeBased](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#isTimeBased())() Checks if this unit represents a component of a time. |
| abstract [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalUnit.html#toString())() Gets a descriptive name for the unit. |

## Enum Values

#### public static final ChronoUnit
**CENTURIES**

Unit that represents the concept of a century.
For the ISO calendar system, it is equal to 100 years.


When used with other calendar systems it must correspond to an integral number of days
and is normally an integral number of years.

#### public static final ChronoUnit
**DAYS**

Unit that represents the concept of a day.
For the ISO calendar system, it is the standard day from midnight to midnight.
The estimated duration of a day is `24 Hours`.


When used with other calendar systems it must correspond to the day defined by
the rising and setting of the Sun on Earth. It is not required that days begin
at midnight - when converting between calendar systems, the date should be
equivalent at midday.

#### public static final ChronoUnit
**DECADES**

Unit that represents the concept of a decade.
For the ISO calendar system, it is equal to 10 years.


When used with other calendar systems it must correspond to an integral number of days
and is normally an integral number of years.

#### public static final ChronoUnit
**ERAS**

Unit that represents the concept of an era.
The ISO calendar system doesn't have eras thus it is impossible to add
an era to a date or date-time.
The estimated duration of the era is artificially defined as `1,000,000,000 Years`.


When used with other calendar systems there are no restrictions on the unit.

#### public static final ChronoUnit
**FOREVER**

Artificial unit that represents the concept of forever.
This is primarily used with `https://developers.google.com/j2objc/javadoc/jre/reference/java/time/temporal/TemporalField.html` to represent unbounded fields
such as the year or era.
The estimated duration of the era is artificially defined as the largest duration
supported by `Duration`.

#### public static final ChronoUnit
**HALF_DAYS**

Unit that represents the concept of half a day, as used in AM/PM.
For the ISO calendar system, it is equal to 12 hours.

#### public static final ChronoUnit
**HOURS**

Unit that represents the concept of an hour.
For the ISO calendar system, it is equal to 60 minutes.

#### public static final ChronoUnit
**MICROS**

Unit that represents the concept of a microsecond.
For the ISO calendar system, it is equal to the 1,000,000th part of the second unit.

#### public static final ChronoUnit
**MILLENNIA**

Unit that represents the concept of a millennium.
For the ISO calendar system, it is equal to 1000 years.


When used with other calendar systems it must correspond to an integral number of days
and is normally an integral number of years.

#### public static final ChronoUnit
**MILLIS**

Unit that represents the concept of a millisecond.
For the ISO calendar system, it is equal to the 1000th part of the second unit.

#### public static final ChronoUnit
**MINUTES**

Unit that represents the concept of a minute.
For the ISO calendar system, it is equal to 60 seconds.

#### public static final ChronoUnit
**MONTHS**

Unit that represents the concept of a month.
For the ISO calendar system, the length of the month varies by month-of-year.
The estimated duration of a month is one twelfth of `365.2425 Days`.


When used with other calendar systems it must correspond to an integral number of days.

#### public static final ChronoUnit
**NANOS**

Unit that represents the concept of a nanosecond, the smallest supported unit of time.
For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.

#### public static final ChronoUnit
**SECONDS**

Unit that represents the concept of a second.
For the ISO calendar system, it is equal to the second in the SI system
of units, except around a leap-second.

#### public static final ChronoUnit
**WEEKS**

Unit that represents the concept of a week.
For the ISO calendar system, it is equal to 7 days.


When used with other calendar systems it must correspond to an integral number of days.

#### public static final ChronoUnit
**YEARS**

Unit that represents the concept of a year.
For the ISO calendar system, it is equal to 12 months.
The estimated duration of a year is `365.2425 Days`.


When used with other calendar systems it must correspond to an integral number of days
or months roughly equal to a year defined by the passage of the Earth around the Sun.