Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python string to datetime

from datetime import datetime

my_date_string = "Mar 11 2011 11:31AM"

datetime_object = datetime.strptime(my_date_string, '%b %d %Y %I:%M%p')

print(type(datetime_object))
print(datetime_object)
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #string #datetime
ADD COMMENT
Topic
Name
3+4 =