We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
 - Algorithms
 - Warmup
 - Time Conversion
 - Discussions
 
Time Conversion
Time Conversion
Sort by
recency
|
5169 Discussions
|
Please Login in order to post a comment
Can you help me to integrate this time conversion code into my Ninja Arashi game? I am currently working on building an advance version of the game. So users can enjoy every feature of the game to make it realistic.
python using array slicing:
def timeConversion(s): newS = "" if "AM" in s and "12" in s: newS = "00" elif "PM" in s and "12" not in str(s[:2]): newS = str(int(s[:2]) + 12) else: return s[:len(s)-2] return newS + s[2:len(s)-2]
Loving python... from datetime import datetime
Java 8 based with 2 different approaches