To parse string into java.util.Date
use java.text.SimpleDateFormat
.
Example :
String testDate = "09-May-2015,23:10:14 PM";
DateFormat formatter = new SimpleDateFormat("d-MMM-yyyy , HH:mm:ss aaa");
Date date = formatter.parse(testDate);
System.out.println(date);
1
solved How to handle an unparseable date? [duplicate]