You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are given a time in 12-hour AM/PM format. Your task is to convert it into military (24-hour) time format.
Rules:
12:00:00 AM on a 12-hour clock is 00:00:00 on a 24-hour clock.
12:00:00 PM on a 12-hour clock is 12:00:00 on a 24-hour clock.
Function Description:
Complete the function timeConversion that converts the input time from the 12-hour format to 24-hour format.
Input:
A string s representing the time in the format hh:mm:ss AM or hh:mm:ssPM.
You are given a time in 12-hour AM/PM format. Your task is to convert it into military (24-hour) time format.
Rules:
12:00:00 AM on a 12-hour clock is 00:00:00 on a 24-hour clock.
12:00:00 PM on a 12-hour clock is 12:00:00 on a 24-hour clock.
Function Description:
Complete the function timeConversion that converts the input time from the 12-hour format to 24-hour format.
Input:
A string s representing the time in the format hh:mm:ss AM or hh:mm:ssPM.
Output:
Return the time in 24-hour military format.
Constraints:
All input times will be valid.
Examples:
Sample Input 1:
07:05:45PM
Sample Output 1:
19:05:45
Sample Input 2:
12:00:00AM
Sample Output 2:
00:00:00
I request you to assign me this issue please.
The text was updated successfully, but these errors were encountered: