Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Time Converter (12h to 24h) by Moff
import re
def time_converter(time):
h, m, x = (f(a) for f, a in zip((int, int, str), re.match('^(\d+):(\d+)\s(a|p)\.m\.$', time).groups()))
if x == 'p' and h < 12:
h += 12
elif x == 'a' and h * 60 + m == 720:
h = 0
return f'{h:02d}:{m:02d}'
May 25, 2018
Comments: