How can I convert from "2014-10-13T10:41:22.863+08:00" into "2014-10-13 10:41"?
I have failed to do so:
String date = "2014-10-13T10:41:22.863+8:00";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date dateTime = null;
try {
dateTime = dateFormat.parse(date);
} catch(ParseException e) { ... }
System.out.printf(dateTime.toString());
through : ParseException 2014-10-13T10:41:22.863+8:00
Anonymous User
14-Oct-2014Anonymous User
14-Oct-2014Try this way,hope this will help you to solve your problem.
The Z at the end is usually the timezone offset. If you you don't need it maybe you can drop it on both sides.