You are viewing a single comment's thread. Return to all comments →
py
def timeConversion(s): a_p=s[-2:] split_clck=[i[:2] if len(i)>3 else i for i in s.split(':')] if (a_p=='PM') & (int(split_clck[0])<12): return '{}:{}:{}'.format(str(int(split_clck[0])+12),split_clck[1],split_clck[2]) elif (a_p=='AM') & (int(split_clck[0])>=12): return '{}:{}:{}'.format('0'+str(int(split_clck[0])-12),split_clck[1],split_clck[2]) else: return '{}:{}:{}'.format(split_clck[0],split_clck[1],split_clck[2])
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 →
py