I am using a SimpleCursorAdapter to populate an Android ListView, and was wondering how I should go about getting all of the timestamps I get from a database, each in \"DATE
I found it easiest to do the following:
SimpleDateFormat oldTime = new SimpleDateFormat("HH:mm:ss");
SimpleDateFormat newTime = new SimpleDateFormat("hh:mm:ss a");
String stringTime;
try {
String reformattedStr = newTime.format(oldTime.parse(stringTime));
} catch (ParseException e) {
e.printStackTrace();
}