>>> from datetime import datetime
>>> m2 = '1:35 PM'
>>> in_time = datetime.strptime(m2, "%I:%M %p") #Converts string to 12 hour time format
>>> out_time = datetime.strftime(in_time, "%H:%M") #Converts 12 hour to 24 hour time format
>>> print(out_time)
13:35