I have done following code:
String str = \"2013-01-17 11:26\"; DateFormat dateFormat = new SimpleDateFormat(\"yyyy-mm-dd hh:MM\"); Date date = dateFormat.parse(s
The following code should work well:
try{ String str = "2013-01-17 11:26"; DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm"); Date date = (Date)dateFormat.parse(str); System.out.println("str :"+str); System.out.println("Date :"+date); } catch(Exception e){ e.getStackTrace(); }