You are viewing a single comment's thread. Return to all comments →
Java 15
int hour = Integer.parseInt(s.substring(0, 2)); if (s.charAt(8) == 'P') { if (hour != 12) hour = (hour + 12) % 24; } else if (hour == 12) hour = (hour + 12) % 24; String hr = Integer.toString(hour); if (hr.length() == 1) hr = "0".concat(hr); return hr.concat(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 →
Java 15