Example usage for java.time DayOfWeek adjustInto

List of usage examples for java.time DayOfWeek adjustInto

Introduction

In this page you can find the example usage for java.time DayOfWeek adjustInto.

Prototype

@Override
public Temporal adjustInto(Temporal temporal) 

Source Link

Document

Adjusts the specified temporal object to have this day-of-week.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate localDate = LocalDate.of(2014, Month.JUNE, 21);
    DayOfWeek dayOfWeek = DayOfWeek.from(localDate);

    Temporal i = dayOfWeek.adjustInto(LocalDate.of(2014, Month.MAY, 22));
    System.out.println(i);/*from   ww  w  .j  a  va2 s. c o m*/

}