I would like to analyze the date. My string date is "Thu January 19, 2012 20:00." And my code to parse:
format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm aaa"); this.settDate(new Timestamp((format.parse(sDate)).getTime()));
However, this will not work. How can I analyze this date?
Full method:
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 an exception:
java.text.ParseException: Unparseable date: "Thu Jan 19 2012 01:00 AM"
Debug image:

Thanks!
source share