You are viewing a single comment's thread. Return to all comments →
public static String timeConversion(String s) { // Write your code here String hours = s.substring(0,2) ; String restOfTime = s.substring(2,8); String meridian = s.substring(8); if((meridian.equals("PM")) && !hours.equals("12")){ hours = String.valueOf(Integer.parseInt(hours)+12) ; }else if(meridian.equals("AM") && hours.equals("12")){ hours="00"; } return hours + restOfTime; }
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 →