YearMonth.minus

Returns a copy of this year-month with the specified amount subtracted. !(p) This returns a {@code YearMonth}, 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 a {@code YearMonth} based on this year-month 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. YearMonth minus(TemporalAmount amountToSubtract)
  2. YearMonth minus(long amountToSubtract, TemporalUnit unit)
    class YearMonth

Meta