You are viewing a single comment's thread. Return to all comments →
public static String timeConversion(String s) { int shift = s.endsWith("PM") ? 12 : 0; int hours = Integer.parseInt(s.substring(0, 2)); hours = (hours == 12) ? shift : hours + shift; return String.format("%02d%s", hours, s.substring(2, 8)); }
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →