java.time.YearMonth.adjustInto() 方法示例


java.time.YearMonth.adjustInto() 方法示例

package com.codingdict;

import java.time.LocalDate;
import java.time.YearMonth;

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

      YearMonth year = YearMonth.of(2015,12);

      LocalDate date = LocalDate.now();
      System.out.println(date);  

      date = (LocalDate)year.adjustInto(date);
      System.out.println(date);  
   }
}