0

How to be able to know the date of a specific day in next month in java

for example if I enter Friday I need the output to be as following

Friday 9 Jun 2017 Friday 16 Jun 2017 Friday 23 Jun 2017 Friday 30 Jun 2017

Amira Elsayed Ismail
  • 8,822
  • 30
  • 81
  • 160

1 Answers1

2
LocalDate.of( 2017 , Month.JUNE , 9 )
     .with( TemporalAdjusters.next( DayOfWeek.FRIDAY ) )

You can use java.time.LocalDate and java.time.TemporalAdjusters

java.time API

For Android library to do this code, use the ThreeTenABP project, an adaptation of the ThreeTen-Backport project. See How to use ThreeTenABP.

Basil Bourque
  • 262,936
  • 84
  • 758
  • 1,028
fg78nc
  • 4,292
  • 2
  • 17
  • 28