wes d2a2ba9e15 first commit | 4 년 전 | |
---|---|---|
.. | ||
README.md | 4 년 전 | |
code.cpp | 4 년 전 | |
unitTest.cpp | 4 년 전 |
by Matt tags: strings, numbers, dates
Write a function that receives the time in 12-hour AM/PM format and returns a string representation of the time in military (24-hour) format. Examples convertTime(“07:05:45PM”) ➞ “19:05:45” convertTime(“12:40:22AM”) ➞ “00:40:22” convertTime(“12:45:54PM”) ➞ “12:45:54” Notes Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is
Write a function that receives the time in 12-hour AM/PM format and returns a string representation of the time in military (24-hour) format.
convertTime(“07:05:45PM”) ➞ “19:05:45”
convertTime(“12:40:22AM”) ➞ “00:40:22”
convertTime(“12:45:54PM”) ➞ “12:45:54”