Given a time in 12-hour AM/PM format, convert it to military (24-hour) time.
Input: 07:05:45PM
Output: 19:05:45
Input: 12:00:00AM
Output: 00:00:00
hh:mm:ssAM or hh:mm:ssPM.When the function convertTimeFormat is called with the given example inputs, the expected outputs are:
"07:05:45PM", the output is "19:05:45"."12:00:00AM", the output is "00:00:00".These outputs represent the time in military format.
console.log(convertTimeFormat('07:05:45PM')); // Output: '19:05:45'
console.log(convertTimeFormat('12:00:00AM')); // Output: '00:00:00'
Memory: 0
CPU: 0