String stringDate="2014-03-20T17:59:03+07:00";
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Date startDate = df.parse(stringDate);
But I got an error that java.text.ParseException: Unparseable date: "2014-03-20T17:59:03+07:00"
Format Wrong:
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
here
Edit :
String stringDate="2014-03-20T17:59:03+07:00";//2014-03-20T17:59:03+07:00 2014-03-20T17:59:03-07:00
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
try {
Date startDate = sdf.parse(stringDate);
System.out.println(startDate);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With