You are viewing a single comment's thread. Return to all comments →
Typescript:
let hours = s.split(':')[0].toString(); let minutes = s.split(':')[1].toString(); let seconds = (s.split(':')[2].slice(0, 2)).toString(); let timeType = s.split(':')[2].slice(-2); if (timeType == 'AM' && hours == '12') { hours = '00'; } else if (timeType == 'PM' && Number(hours) < 12) { hours = (Number(hours) + 12).toString(); } return `${hours}:${minutes}:${seconds}`;
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 →
Typescript: