Time Conversion
Given a time in 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 a 12-hour clock, and 12:00:00 on a 24-hour clock.
Input:
A single line containing string str, containing a time in 12-hour clock format.
Output:
Convert and print the given time in 24-hour format.
Examples:
Input:
07:05:45 PM
Output:
19:05:45
My question is:
Develop a Java program code for it, and please I don't want the old solutions from Chegg or any other website.