Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Conversion #319

Open
Keshara1997 opened this issue Oct 19, 2024 · 0 comments
Open

Time Conversion #319

Keshara1997 opened this issue Oct 19, 2024 · 0 comments

Comments

@Keshara1997
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant