Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First: Using the time module solution in Clear category for Time Converter (24h to 12h) by carel.anthonissen
import time as tm
def time_converter(time):
# User the time module to parse and format the time
time = tm.strftime('%-I:%M %p',tm.strptime(time,'%H:%M'))
# Convert AM/PM to the requried format (could hack the locale instead?)
time = time.replace('PM','p.m.')
time = time.replace('AM','a.m.')
return time
May 4, 2019
Comments: