You are viewing a single comment's thread. Return to all comments →
def ldec(n): return "{:02d}".format(n) def timeConversion(s): ampm = s[-2:] time = s[:-2].split(":") hours = int(time.pop(0)) minutes = int(time.pop(0)) seconds = int(time.pop(0)) if (ampm == "PM" and hours != 12) or (ampm == "AM" and hours == 12): hours += 12 return f"{ldec(hours%24)}:{ldec(minutes)}:{ldec(seconds)}"
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →