JavaScript
C
C++
Python
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
hh:mm:ssPM
When the function convertTimeFormat is called with the given example inputs, the expected outputs are:
convertTimeFormat
"07:05:45PM"
"19:05:45"
"12:00:00AM"
"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