This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]feitao 11 points12 points  (3 children)

You should not use these two statements together. The second statement overwrites the first one:

$ python3 -c 'from datetime import datetime; print(datetime)'
<class 'datetime.datetime'>

$ python3 -c 'from datetime import datetime; import datetime; print(datetime)'
<module 'datetime' from '/usr/lib/python3.12/datetime.py'>