You are viewing a single comment's thread. Return to all comments →
String period = s.substring(s.length() - 2); int hour = Integer.parseInt(s.substring(0, 2)); if(period.equals("AM")){ if(hour == 12){ hour = 0; } } //Periods is PM else{ if(hour != 12){ hour += 12; } String milHour = String.format("%02d", hour); return milHour+s.substring(2, s.length()-2); }
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 →