You are viewing a single comment's thread. Return to all comments →
A simpler way with Java;
import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; class Result { private static final DateFormat TWELVE_TF = new SimpleDateFormat("hh:mm:ssa"); private static final DateFormat TWENTY_FOUR_TF = new SimpleDateFormat("HH:mm:ss"); public static String timeConversion(String s) { try { return TWENTY_FOUR_TF.format( TWELVE_TF.parse(s)); } catch (ParseException e) { return s; } } }
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 →
A simpler way with Java;