0 votes
12 views

How will you get second saturday of next month using java8 in Java8?

in Education by (51.6k points)

1 Answer

0 votes

How will you get second saturday of next month using java8 in Java8?

Following code gets second saturday of next month using java8 -

//get the second saturday of next month

LocalDate firstInYear = LocalDate.of(date1.getYear(),date1.getMonth(), 1);

LocalDate secondSaturday = firstInYear.with(TemporalAdjusters.nextOrSame(DayOfWeek.SATURDAY)).with(TemporalAdjusters.next(DayOfWeek.SATURDAY));

System.out.println("Second Saturday on : " + secondSaturday);

by (51.6k points)

Related questions

0 votes
1 answer 10 views
0 votes
1 answer 17 views
0 votes
1 answer 12 views
0 votes
1 answer 10 views
0 votes
1 answer 21 views
0 votes
1 answer 12 views
0 votes
1 answer 8 views
0 votes
1 answer 13 views
...