In an Android app I have an internal logging method and I add a time-date stamp to the start of each message . . .
public void logEvent(String sMsg) {
String delegate = "MM/dd/yy hh:mm:ss";
java.util.Date noteTS = Calendar.getInstance().getTime();
String sTod = " " + DateFormat.format(delegate,noteTS);
sMsg = sTod + " " + sMsg;
logEvents.add(sMsg);
. . .
This produces a time-date stamp that looks like "07/25/14 02:58:18". But I want the time to be in 24 hour format, i.e., "14:58:18".
In some systems that's accomplished by using "HH" instead of "hh" so I tried that, i.e.,
String delegate = "MM/dd/yy HH:mm:ss";
... but that just gave me "07/25/14 HH:58:18"
So what do I have to do to get the hours to be in 24-hour format?