You are viewing a single comment's thread. Return to all comments →
My solution in JS
var splitted = s.split(":") var time = splitted[splitted.length -1].substring(2) if(time == "PM") { var hour = parseInt(splitted[0]) if(hour != "12") { hour = 12 + hour } return hour + ":" +splitted[1] +":" + splitted[2].substring(0,2) } else { if(splitted[0] == "12") { splitted[0] = "00" } return splitted[0] + ":" +splitted[1] +":" + splitted[2].substring(0,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 →
My solution in JS