Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Time Converter (24h to 12h) by OleksiyKhomenko
def time_converter(time):
h, m = int(time[:2]), time[2:]
half = "a.m." if h < 12 else "p.m."
h = h if 0 < h <= 12 else abs(h - 12)
return ("{0}{1} {2}".format(h, m, half))
March 17, 2020