I want to convert a String containing a date to Timestamp.
My String is something like this: 2014-06-10T03:03
What I try to do:
Date startDate = null, endDate = null;
try {
startDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(fromDate);
} catch (ParseException e) {
e.printStackTrace();
}
try {
endDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss")
.parse(toDate);
} catch (ParseException e) {
e.printStackTrace();
}
But I get this error:
java.text.ParseException: Unparseable date: "2014-06-10T03:03".