How do i get a date by giving the week of the month and day of the week.
Example: If i need the third tuesday of November 2018.
Week of month : 3, Day of Week : 3
Expected date is : Nov 20 2018
But the value we get is : Nov 13 2018. Since the start day of the month (thursday) is less than than the expected day(tuesday).
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR,2018 );
calendar.set(Calendar.MONTH, 10);
calendar.set(Calendar.WEEK_OF_MONTH, 3);
calendar.set(Calendar.DAY_OF_WEEK, 3);
System.out.println("Time " + calendar.getTime());
How do i get the correct date??