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


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

package com.codingdict;

import java.time.DayOfWeek;
import java.time.ZonedDateTime;

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

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

      DayOfWeek dayOfWeek = DayOfWeek.of(1);

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