I am trying to convert Date and time to calendar, while converting i am facing
java.text.ParseException: Unparseable date: "01/11/2012 08:00:00"
Here is my sample code :
Calendar cal = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy H:mm:ss", new Locale("es", "ES"));
cal.setTime(formatter.parse(Form.getRequestPortDate()+" "+.getRequestTimeDD()+":00"));
Note : Value of Form.getRequestPortDate()+" "+Form.getRequestTimeDD()+":00") is 01/11/2012 08:00:00.
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy H:mm:ss", new Locale("es", "ES"));This means that you will be able to only parse the dates in the format
dd-MMM-yyyy H:mm:ss.If you are getting dates in the format “01/11/2012 08:00:00” then you should use this string inside your
SimpleDateFormatter: