![]() |
VOOZH | about |
Given a time at 12-hour AM/PM format, convert it to military (24-hour) time.
Note: Midnight is 12:00:00 AM on a 12-hour clock and 00:00:00 on a 24-hour clock. Noon is 12:00:00 PM on 12-hour clock and 12:00:00 on 24-hour clock
Examples:
Input: 07:05:45 PM
Output: 19:05:45
Explanation: On converting the given time from 12 hour format to 24 hour format we get 19:05:45Input: 02:15:05 AM
Output: 02:15:05
Explanation: On converting the given time from 12 hour format to 24 hour format we get 02:15:05
19:05:45
Time Complexity: O(1)
Auxiliary Space: O(1)
19:05:45
Time Complexity: O(1)
Auxiliary Space: O(1)