Instant.minus

Returns a copy of this instant with the specified amount subtracted. !(p) This returns an {@code Instant}, based on this one, with the amount _in terms of the unit subtracted. If it is not possible to subtract the amount, because the unit is not supported or for some other reason, an exception is thrown. !(p) This method is equivalent to {@link #plus(long, TemporalUnit)} with the amount negated. See that method for a full description of how addition, and thus subtraction, works. !(p) This instance is immutable and unaffected by this method call.

@param amountToSubtract the amount of the unit to subtract from the result, may be negative @param unit the unit of the amount to subtract, not null @return an {@code Instant} based on this instant with the specified amount subtracted, not null @throws DateTimeException if the subtraction cannot be made @throws UnsupportedTemporalTypeException if the unit is not supported @throws ArithmeticException if numeric overflow occurs

  1. Instant minus(TemporalAmount amountToSubtract)
  2. Instant minus(long amountToSubtract, TemporalUnit unit)
    class Instant

Meta