How can I convert year and week to Java Date object? I'm using JodaTime, but standard Java classes using solution is fine too.
Solution using standard java classes. This just gets the current time and sets the fields of year and week of year to known values.
Calendar cld = Calendar.getInstance();
cld.set(Calendar.YEAR, year);
cld.set(Calendar.WEEK_OF_YEAR, week);
Date result = cld.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