Write a Python program to convert a string to datetime.


Topic: Write a Python program to convert a string to datetime.

Solution

from datetime import datetime
date_object = datetime.strptime('Jul 1 2014 2:43PM', '%b %d %Y %I:%M%p')
print(date_object)



List all Python Programs