Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

How can I resolve java text parseexception unparseable date exception?

Asked by Deirdre Cameron Apr 6, 2021 2.7K views 1 answer
Share

About this question

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?

Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.