>>> from datetime import * >>> m2 = '1:35 PM' >>> m2 = datetime.strptime(m2, '%I:%M %p') >>> print(m2) 1900-01-01 13:35:00