Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Creative category for Time Converter (12h to 24h) by yoichi
def time_converter(time):
t, ampm = time.split()
h, m = t.split(":")
return str.format(
"{:02}:{:02}",
*map(sum,
zip(map(int, (h, m)),
(12 if ampm == 'p.m.' and h != '12' else 0, 0),
(-12 if ampm == 'a.m.' and h == '12' else 0, 0))))
Nov. 28, 2018