Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
f-strings solution in Clear category for Time Converter (24h to 12h) by David_Jones
def time_converter(time):
hh, mm = time.split(':')
hh = int(hh)
if hh < 12:
if time == '00:00':
hh = 12
return f'{hh}:{mm} a.m.'
return f'{(hh - 12) or hh}:{mm} p.m.'
May 2, 2019
Comments: