package com.logicbig.example;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
import java.time.YearMonth;
import java.time.temporal.TemporalAdjusters;
public class DateAtNWeekDay {
public static void main (String[] args) {
//from LocalDate
LocalDate d = LocalDate.of(2017, Month.JANUARY, 10);
LocalDate d2 = d.with(
TemporalAdjusters.dayOfWeekInMonth(3, DayOfWeek.MONDAY));
System.out.println(d2);
//from YearMonth
YearMonth ym = YearMonth.of(2017, Month.JANUARY);
LocalDate d3 = ym.atDay(1)
.with(TemporalAdjusters.dayOfWeekInMonth(
3, DayOfWeek.MONDAY));
System.out.println(d3);
}
}