Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Time Converter (12h to 24h) by _Chico_
def time_converter(time):
h,m,a=[time.split(" ")[0].split(":")[0],time.split(" ")[0].split(":")[1],time.split(" ")[1]]
if a=="a.m.":
if int(h)<10:return "0"+":".join([h,m])
else:return ":".join([h,m]) if int(h)!=12 else "00:"+m
else:return ":".join([str(int(h)+12),m]) if int(h)!=12 else ":".join([h,m])
July 9, 2021