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 rodka81
import re
def time_converter(time):
m = re.search(r'(\d+):(\d+) ([ap]).m.', time)
hh, mm = int(m.group(1)) % 12, int(m.group(2))
if 'p' in m.group(3):
hh += 12
return "{:02d}:{:02d}".format(hh, mm)
Sept. 5, 2018
Comments: