public LocalDate minusMonths (long monthsToSubtract)

Returns a copy of this LocalDate with the specified number of months subtracted.

This method subtracts the specified amount from the months field in three steps:

  1. Subtract the input months from the month-of-year field
  2. Check if the resulting date would be invalid
  3. Adjust the day-of-month to the last valid day if necessary

For example, 2007-03-31 minus one month would result in the invalid date 2007-02-31. Instead of returning an invalid result, the last valid day of the month, 2007-02-28, is selected instead.

This instance is immutable and unaffected by this method call.

Parameters:
monthsToSubtract    the months to subtract, may be negative

Returns:  a LocalDate based on this date with the months subtracted, not null

Exceptions:
DateTimeException    if the result exceeds the supported date range