Reputation: 13835
I searched on StackOverflow for the same, but all the answers are for legacy java versions. I did not find any of the answers with Java 8 Data and Time utility. Can anybody help me out for the same?
Upvotes: 0
Views: 662
Reputation: 13835
I find out a way using LocalDate and TemporalAdjuster's with() method as follows:
LocalDate firstSundayOfNextMonth = LocalDate
.now()
.with(firstDayOfNextMonth())
.with(nextOrSame(DayOfWeek.SUNDAY));
Upvotes: 3