You are viewing a single comment's thread. Return to all comments →
Java
public static String timeConversion(String s) { if (s.charAt(8) == 'P') { if (Integer.valueOf(s.substring(0, 2)) < 12) { String res = String.valueOf(Integer.valueOf(s.substring(0, 2)) + 12); res = res.concat(s.substring(2, 8)); return res; } else return s.substring(0, 8); } else { if (Integer.valueOf(s.substring(0, 2)) < 12) { return s.substring(0, 8); } else { String res = "00"; res = res.concat(s.substring(2, 8)); return res; } } }
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 →
Java