Java 8 Time API: how to parse string of format “MM.yyyy” to LocalDate
It makes sense: your input is not really a date because it does not have a day information. You should parse it as a YearMonth and use that result if you don’t care about the day. String date = “04.2013”; DateTimeFormatter formatter = DateTimeFormatter.ofPattern(“MM.yyyy”); YearMonth ym = YearMonth.parse(date, formatter); If you do need to apply … Read more