java.text.ParseException: Unparseable date: “2014-06-04” (at offset 5)

后端 未结 4 1772
名媛妹妹
名媛妹妹 2021-01-04 19:14

I want to parse the date into a desired format but i am receiving an exception every time. i know it is easy to implement but i am facing some problem don\'t know where exac

4条回答
  •  醉梦人生
    2021-01-04 19:32

    In my case, I was using ::

    SimpleDateFormat todaySdf = new SimpleDateFormat("dd MMM yyyy", Locale.ENGLISH);
    

    changed it to

    SimpleDateFormat todaySdf = new SimpleDateFormat("dd MM yyyy", Locale.ENGLISH);
    

    and it worked.. the extra M was the culprit !!

提交回复
热议问题