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


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

package com.codingdict;

import java.time.Month;
import java.time.ZonedDateTime;

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

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

      Month month = Month.of(1);

      date = (ZonedDateTime)month.adjustInto(date);
      System.out.println(date);  
   }
}