Uses of Class
org.threeten.bp.Duration
Packages that use Duration
Package
Description
The main API for dates, times, instants, and durations.
Access to date and time using fields and units.
Support for time-zones and their rules.
-
Uses of Duration in org.threeten.bp
Fields in org.threeten.bp declared as DurationModifier and TypeFieldDescriptionstatic final DurationDuration.ZEROConstant for a duration of zero.Methods in org.threeten.bp that return DurationModifier and TypeMethodDescriptionDuration.abs()Returns a copy of this duration with a positive length.static DurationObtains an instance ofDurationrepresenting the duration between two instants.Duration.dividedBy(long divisor) Returns a copy of this duration divided by the specified value.static DurationDuration.from(TemporalAmount amount) Obtains an instance ofDurationfrom an amount.Duration.minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this duration with the specified duration subtracted.Returns a copy of this duration with the specified duration subtracted.Duration.minusDays(long daysToSubtract) Returns a copy of this duration with the specified duration in 24 hour days subtracted.Duration.minusHours(long hoursToSubtract) Returns a copy of this duration with the specified duration in hours subtracted.Duration.minusMillis(long millisToSubtract) Returns a copy of this duration with the specified duration in milliseconds subtracted.Duration.minusMinutes(long minutesToSubtract) Returns a copy of this duration with the specified duration in minutes subtracted.Duration.minusNanos(long nanosToSubtract) Returns a copy of this duration with the specified duration in nanoseconds subtracted.Duration.minusSeconds(long secondsToSubtract) Returns a copy of this duration with the specified duration in seconds subtracted.Duration.multipliedBy(long multiplicand) Returns a copy of this duration multiplied by the scalar.Duration.negated()Returns a copy of this duration with the length negated.static DurationDuration.of(long amount, TemporalUnit unit) Obtains an instance ofDurationfrom a duration in the specified unit.static DurationDuration.ofDays(long days) Obtains an instance ofDurationfrom a number of standard 24 hour days.static DurationDuration.ofHours(long hours) Obtains an instance ofDurationfrom a number of standard length hours.static DurationDuration.ofMillis(long millis) Obtains an instance ofDurationfrom a number of milliseconds.static DurationDuration.ofMinutes(long minutes) Obtains an instance ofDurationfrom a number of standard length minutes.static DurationDuration.ofNanos(long nanos) Obtains an instance ofDurationfrom a number of nanoseconds.static DurationDuration.ofSeconds(long seconds) Obtains an instance ofDurationfrom a number of seconds.static DurationDuration.ofSeconds(long seconds, long nanoAdjustment) Obtains an instance ofDurationfrom a number of seconds and an adjustment in nanoseconds.static DurationDuration.parse(CharSequence text) Obtains aDurationfrom a text string such asPnDTnHnMn.nS.Duration.plus(long amountToAdd, TemporalUnit unit) Returns a copy of this duration with the specified duration added.Returns a copy of this duration with the specified duration added.Duration.plusDays(long daysToAdd) Returns a copy of this duration with the specified duration in 24 hour days added.Duration.plusHours(long hoursToAdd) Returns a copy of this duration with the specified duration in hours added.Duration.plusMillis(long millisToAdd) Returns a copy of this duration with the specified duration in milliseconds added.Duration.plusMinutes(long minutesToAdd) Returns a copy of this duration with the specified duration in minutes added.Duration.plusNanos(long nanosToAdd) Returns a copy of this duration with the specified duration in nanoseconds added.Duration.plusSeconds(long secondsToAdd) Returns a copy of this duration with the specified duration in seconds added.Duration.withNanos(int nanoOfSecond) Returns a copy of this duration with the specified nano-of-second.Duration.withSeconds(long seconds) Returns a copy of this duration with the specified amount of seconds.Methods in org.threeten.bp with parameters of type DurationModifier and TypeMethodDescriptionintCompares this duration to the specifiedDuration.Returns a copy of this duration with the specified duration subtracted.static ClockObtains a clock that returns instants from the specified clock with the specified duration addedReturns a copy of this duration with the specified duration added.static ClockObtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration. -
Uses of Duration in org.threeten.bp.temporal
Methods in org.threeten.bp.temporal that return DurationModifier and TypeMethodDescriptionChronoUnit.getDuration()Gets the estimated duration of this unit in the ISO calendar system.TemporalUnit.getDuration()Gets the duration of this unit, which may be an estimate. -
Uses of Duration in org.threeten.bp.zone
Methods in org.threeten.bp.zone that return DurationModifier and TypeMethodDescriptionabstract DurationZoneRules.getDaylightSavings(Instant instant) Gets the amount of daylight savings in use for the specified instant in this zone.ZoneOffsetTransition.getDuration()Gets the duration of the transition.