Duration.minus

Returns a copy of this duration with the specified duration subtracted. !(p) The duration amount is measured _in terms of the specified unit. Only a subset of units are accepted by this method. The unit must either have an {@linkplain TemporalUnit#isDurationEstimated() exact duration} or be {@link ChronoUnit#DAYS} which is treated as 24 hours. Other units throw an exception. !(p) This instance is immutable and unaffected by this method call.

@param amountToSubtract the amount to subtract, measured _in terms of the unit, positive or negative @param unit the unit that the amount is measured _in, must have an exact duration, not null @return a {@code Duration} based on this duration with the specified duration subtracted, not null @throws ArithmeticException if numeric overflow occurs

  1. Duration minus(Duration duration)
  2. Duration minus(long amountToSubtract, TemporalUnit unit)
    class Duration

Meta