How can I resolve java text parseexception unparseable date exception?

2.2K    Asked by DeirdreCameron in Java , Asked on Apr 6, 2021

While executing the below code, it throws a parsing exception:

String date="Sat Jun 01 12:53:10 IST 2013";

    SimpleDateFormat sdf=new SimpleDateFormat("MMM d, yyyy HH:mm:ss");

    Date currentdate;

    currentdate=sdf.parse(date);

    System.out.println(currentdate);

Exception :

Exception in thread "main" java.text.ParseException: Unparseable date: "Sat Jun 01 12:53:10 IST 2013" at com.ibm.icu.text.DateFormat.parse(DateFormat.java:510)

How can i resolve this exception?

Answered by Fiona Dickens

Your Answer

Interviews

Parent Categories