Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
f-string formatting solution in Clear category for Time Converter (24h to 12h) by imtiaz.rahi
def time_converter(time):
h, m = map(int, time.split(":"))
suffix = "p.m." if h > 11 else "a.m."
return f'{(h-1)%12+1}:{m:02d} {suffix}'
Oct. 30, 2019
Comments: