ChronoUnit

public final enum ChronoUnit extends Enum<ChronoUnit>
implements TemporalUnit

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 TemporalUnit.

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

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 TemporalField 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.