java.time.YearMonth.minus(TemporalAmount amountToSubtract)


java.time.YearMonth.minus(TemporalAmount amountToSubtract)

package com.codingdict;

import java.time.Period;
import java.time.YearMonth;
import java.time.temporal.ChronoField;

public class YearMonthDemo {
   public static void main(String[] args) {

      YearMonth date = YearMonth.of(2017,12);
      System.out.println(date.get(ChronoField.MONTH_OF_YEAR));
      System.out.println(date.minus(Period.ofMonths(4)).get(ChronoField.MONTH_OF_YEAR));
   }
}