Changing one date to another date format using LocalDate
问题 I have the following input as a Map<String,String> 1) MM dd yyyy = 08 10 2019 2) dd MM yyyy = 10 05 2019 3) dd MM yyyy = 05 10 2008 4) yyyy dd MM = 2001 24 01 I want to convert all this dates to "yyyy-MM-dd" format Currently, i am using for (String eachFormat : formats) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(eachFormat); try { SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd"); Date inputDate = simpleDateFormat.parse(parsedDate.get(eachFormat)); return