I know the week number of the year, a week is start from Sunday, then Monday, Tuesday...,Saturday.
Since I know the week number, what's the efficient way to get the dates of the specific week by using Java code??
If you don't want external library, just use calendar.
SimpleDateFormat sdf = new SimpleDateFormat("MM dd yyyy"); Calendar cal = Calendar.getInstance(); cal.set(Calendar.WEEK_OF_YEAR, 23); cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); System.out.println(sdf.format(cal.getTime()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With