I just want to convert a date from the database to 12 hours format which is originally in 24 hours format which is something like this 2015-06-11T28:28:57.000Z
. In here this time format (28:25:57
) seems to be the next day (ie. 2015-06-12T04:28:57
).
I have tried with the following:
String date = "2015-06-11T28:28:57.000Z";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss a");
Date date = formatter.parse(date);
but I got an error like unparsable date.