I would like to parse a date. My String date is "Thu Jan 19 2012 08:00 PM". And my code to parse is:
format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm aaa");
this.settDate(new Timestamp((format.parse(sDate)).getTime()));
However, it does not work. How could I parse this date?
Complete method is:
public void saveTask(int iDevice, String description, String sDate) throws ParseException {
format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm aaa");
this.setiDeviceId(iDevice);
this.setsDescription(description);
this.settDate(new Timestamp((format.parse(sDate)).getTime()));
DatabaseManager.save(this);
}
And exception:
java.text.ParseException: Unparseable date: "Thu Jan 19 2012 01:00 AM"
Debug picture:
Thanks!