java.time.format.DateTimeParseException: Text could not be parsed at index 3

后端 未结 5 1435
醉酒成梦
醉酒成梦 2021-02-06 23:36

I am using Java 8 to parse the the date and find difference between two dates.

Here is my snippet:

String date1 =\"01-JAN-2017\";
String date2 = \"02-FEB         


        
5条回答
  •  醉梦人生
    2021-02-07 00:36

    Try using DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd-LLL-yyyy",Locale.ENGLISH);

提交回复
热议问题