-4
SimpleDateFormat sm=new SimpleDateFormat("MM-dd-yyyy");
    String dateString="22/11/1982";
    Date date;
    try{
        date=sm.parse(dateString);
        cm.setChargeDate(date); 
        System.out.println(date);
    }catch(Exception e){
        e.printStackTrace();
    }
}

Code above gives error:

java.text.ParseException: Unparseable date: "22/11/1982"
    at java.text.DateFormat.parse(DateFormat.java:357)
    at com.rss.master.bean.ChargeExeMappingBean.save(ChargeExeMappingBean.java:452)
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 1
    possible duplicate of [SimpleDateFormat "Unparseable date" Exception](http://stackoverflow.com/questions/7681782/simpledateformat-unparseable-date-exception) – Basil Bourque Jul 25 '15 at 17:46
  • 1
    Please search StackOverflow before posting. The problem of "Unparseable date" has been covered [many many times](http://stackoverflow.com/search?q=Java+date+unparseable) already. – Basil Bourque Jul 25 '15 at 17:48

1 Answers1

1

Your dateFormat is wrong. It must be:

SimpleDateFormat sm=new SimpleDateFormat("dd/MM/yyyy");
Jens
  • 67,715
  • 15
  • 98
  • 113
  • thank you..i got output Tue Oct 11 00:00:00 EST 1983 need date value only how i can remove 00:00:00 EST time value – Raja ts.kutti Jul 25 '15 at 11:56
  • @Rajats.kutti if is not realy clear what the result should be. Please improve your question. – Jens Jul 25 '15 at 12:15