We would like to know how to parse String '2014-W14-2' to LocalDate as ISO_WEEK_DATE.
import java.time.LocalDate; import java.time.format.DateTimeFormatter; /* w w w. j av a2s. c o m*/ public class Main { public static void main(String[] args) { LocalDate fromIsoWeekDate = LocalDate.parse("2014-W14-2", DateTimeFormatter.ISO_WEEK_DATE); System.out.println(fromIsoWeekDate); } }
The code above generates the following result.