The following code is working as expected. But I have 2 questions.
# import datetime # does not work
from datetime import datetime
row = ('2002-01-02 00:00:00.3453', 'a')
x = datetime.strptime(row[0], "%Y-%m-%d %H:%M:%S.%f")
1) Why does only import datetime does not work?
2) How do I know to which module does the ‘strptime’ method belogs to?
>>> help('modules strptime')
does not provide the info I am looking for.
Either you do:
or you do: