forum

Home / DeveloperSection / Forums / How to convert date string in another string?

How to convert date string in another string?

Anonymous User224214-Oct-2014

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


Updated on 14-Oct-2014
I am a content writter !

Can you answer this question?


Answer

2 Answers

Liked By