You are viewing a single comment's thread. Return to all comments →
Java:
public static String timeConversion(String str) {
String time12HourFormat = str; SimpleDateFormat inputFormat = new SimpleDateFormat("hh:mm:ssa"); SimpleDateFormat outputFormat = new SimpleDateFormat("HH:mm:ss"); try{ Date date = inputFormat.parse(time12HourFormat); String time24HourFormat = outputFormat.format(date); return time24HourFormat; } catch (ParseException e) { e.printStackTrace(); } return ""; }
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:
public static String timeConversion(String str) {