You are viewing a single comment's thread. Return to all comments →
python
def timeConversion(s):
len_s = len(s) if len_s !=10: return None am_or_pm = str(s)[len_s-2] time_24 = str(s)[:-2] hour = int(str(s)[:2]) if am_or_pm == 'P' and hour!=12: time_24 = str(hour + 12 )+str(s)[2:-2] else: if am_or_pm == 'A' and hour ==12: time_24 = "00"+str(s)[2:-2] return time_24
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 →
python