I have two integers:
LocalDateTime ldt = LocalDateTime.of(year, 1, 1, 0, 0).plusWeeks(week-1);
The following code will get a
LocalDateTime and set it to the first day of the given week-of-year for the given year:
int week = 1; int year = 2016; WeekFields weekFields = WeekFields.of(Locale.getDefault()); LocalDateTime ldt = LocalDateTime.now() .withYear(year) .with(weekFields.weekOfYear(), week) .with(weekFields.dayOfWeek(), 1); System.out.println(ldt);
Note that the notion of week-of-year is locale specific. Here, I used the default Locale but you might need to use a user-provided locale.
If you want to get rid of the time part, you can add a call to