You are viewing a single comment's thread. Return to all comments →
const am: number = s.search("AM") const pm: number = s.search("PM") const timeText: string[] = s.split(":") if (am > 0) { if (timeText[0] === "12") { return "00:"+timeText[1]+":"+timeText[2].slice(0,2) }else { return s.slice(0, am) } } else if (pm > 0) { return (timeText[0] === "12" ? timeText[0] : parseInt(timeText[0])+12)+":"+timeText[1]+":"+timeText[2].slice(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 →