Uses of Interface
java.time.temporal.TemporalUnit
Packages that use TemporalUnit
Package
Description
The main API for dates, times, instants, and durations.
Generic API for calendar systems other than the default ISO.
Access to date and time using fields and units, and date time adjusters.
-
Uses of TemporalUnit in java.time
Methods in java.time that return types with arguments of type TemporalUnitModifier and TypeMethodDescriptionDuration.getUnits()Gets the set of units supported by this duration.Period.getUnits()Gets the set of units supported by this period.Methods in java.time with parameters of type TemporalUnitModifier and TypeMethodDescriptionlongDuration.get(TemporalUnit unit) Gets the value of the requested unit.longPeriod.get(TemporalUnit unit) Gets the value of the requested unit.booleanInstant.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanLocalDate.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanLocalDateTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanLocalTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanOffsetDateTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanOffsetTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanYear.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanYearMonth.isSupported(TemporalUnit unit) Checks if the specified unit is supported.booleanZonedDateTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.Duration.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this duration with the specified duration subtracted.Instant.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this instant with the specified amount subtracted.LocalDate.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this date with the specified amount subtracted.LocalDateTime.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this date-time with the specified amount subtracted.LocalTime.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this time with the specified amount subtracted.OffsetDateTime.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this date-time with the specified amount subtracted.OffsetTime.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this time with the specified amount subtracted.Year.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this year with the specified amount subtracted.YearMonth.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this year-month with the specified amount subtracted.ZonedDateTime.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this date-time with the specified amount subtracted.static DurationDuration.of(long amount, TemporalUnit unit) Obtains aDurationrepresenting an amount in the specified unit.Duration.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this duration with the specified duration added.Instant.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this instant with the specified amount added.LocalDate.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this date with the specified amount added.LocalDateTime.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this date-time with the specified amount added.LocalTime.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this time with the specified amount added.OffsetDateTime.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this date-time with the specified amount added.OffsetTime.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this time with the specified amount added.Year.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this year with the specified amount added.YearMonth.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this year-month with the specified amount added.ZonedDateTime.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this date-time with the specified amount added.Duration.truncatedTo(TemporalUnit unit) Returns a copy of thisDurationtruncated to the specified unit.Instant.truncatedTo(TemporalUnit unit) Returns a copy of thisInstanttruncated to the specified unit.LocalDateTime.truncatedTo(TemporalUnit unit) Returns a copy of thisLocalDateTimewith the time truncated.LocalTime.truncatedTo(TemporalUnit unit) Returns a copy of thisLocalTimewith the time truncated.OffsetDateTime.truncatedTo(TemporalUnit unit) Returns a copy of thisOffsetDateTimewith the time truncated.OffsetTime.truncatedTo(TemporalUnit unit) Returns a copy of thisOffsetTimewith the time truncated.ZonedDateTime.truncatedTo(TemporalUnit unit) Returns a copy of thisZonedDateTimewith the time truncated.longInstant.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another instant in terms of the specified unit.longLocalDate.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another date in terms of the specified unit.longLocalDateTime.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another date-time in terms of the specified unit.longLocalTime.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another time in terms of the specified unit.longOffsetDateTime.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another date-time in terms of the specified unit.longOffsetTime.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another time in terms of the specified unit.longYear.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another year in terms of the specified unit.longYearMonth.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another year-month in terms of the specified unit.longZonedDateTime.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another date-time in terms of the specified unit. -
Uses of TemporalUnit in java.time.chrono
Methods in java.time.chrono that return types with arguments of type TemporalUnitModifier and TypeMethodDescriptionChronoPeriod.getUnits()Gets the set of units supported by this period.Methods in java.time.chrono with parameters of type TemporalUnitModifier and TypeMethodDescriptionlongChronoPeriod.get(TemporalUnit unit) Gets the value of the requested unit.default booleanChronoLocalDate.isSupported(TemporalUnit unit) Checks if the specified unit is supported.default booleanChronoLocalDateTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.default booleanChronoZonedDateTime.isSupported(TemporalUnit unit) Checks if the specified unit is supported.default ChronoLocalDateChronoLocalDate.minus(long amountToSubtract, TemporalUnit unit) Returns an object of the same type as this object with the specified period subtracted.default ChronoLocalDateTime<D> ChronoLocalDateTime.minus(long amountToSubtract, TemporalUnit unit) Returns an object of the same type as this object with the specified period subtracted.default ChronoZonedDateTime<D> ChronoZonedDateTime.minus(long amountToSubtract, TemporalUnit unit) Returns an object of the same type as this object with the specified period subtracted.HijrahDate.minus(long amountToSubtract, TemporalUnit unit) JapaneseDate.minus(long amountToSubtract, TemporalUnit unit) MinguoDate.minus(long amountToSubtract, TemporalUnit unit) ThaiBuddhistDate.minus(long amountToSubtract, TemporalUnit unit) default ChronoLocalDateChronoLocalDate.plus(long amountToAdd, TemporalUnit unit) Returns an object of the same type as this object with the specified period added.ChronoLocalDateTime.plus(long amountToAdd, TemporalUnit unit) Returns an object of the same type as this object with the specified period added.ChronoZonedDateTime.plus(long amountToAdd, TemporalUnit unit) Returns an object of the same type as this object with the specified period added.HijrahDate.plus(long amountToAdd, TemporalUnit unit) JapaneseDate.plus(long amountToAdd, TemporalUnit unit) MinguoDate.plus(long amountToAdd, TemporalUnit unit) ThaiBuddhistDate.plus(long amountToAdd, TemporalUnit unit) longChronoLocalDate.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another date in terms of the specified unit. -
Uses of TemporalUnit in java.time.temporal
Classes in java.time.temporal that implement TemporalUnitFields in java.time.temporal declared as TemporalUnitModifier and TypeFieldDescriptionstatic final TemporalUnitIsoFields.QUARTER_YEARSUnit that represents the concept of a quarter-year.static final TemporalUnitIsoFields.WEEK_BASED_YEARSThe unit that represents week-based-years for the purpose of addition and subtraction.static final TemporalUnitWeekFields.WEEK_BASED_YEARSThe unit that represents week-based-years for the purpose of addition and subtraction.Methods in java.time.temporal that return TemporalUnitModifier and TypeMethodDescriptionChronoField.getBaseUnit()TemporalField.getBaseUnit()Gets the unit that the field is measured in.ChronoField.getRangeUnit()TemporalField.getRangeUnit()Gets the range that the field is bound by.Methods in java.time.temporal that return types with arguments of type TemporalUnitModifier and TypeMethodDescriptionTemporalAmount.getUnits()Returns the list of units uniquely defining the value of this TemporalAmount.static TemporalQuery<TemporalUnit> TemporalQueries.precision()A query for the smallest supported unit.Methods in java.time.temporal with parameters of type TemporalUnitModifier and TypeMethodDescriptionlongTemporalAmount.get(TemporalUnit unit) Returns the value of the requested unit.booleanTemporal.isSupported(TemporalUnit unit) Checks if the specified unit is supported.default TemporalTemporal.minus(long amountToSubtract, TemporalUnit unit) Returns an object of the same type as this object with the specified period subtracted.Temporal.plus(long amountToAdd, TemporalUnit unit) Returns an object of the same type as this object with the specified period added.longTemporal.until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another temporal in terms of the specified unit.