filmov
tv
How to Fix the Python AttributeError: module ‘datetime’ has no attribute ‘strptime’ | Avoid & Debug

Показать описание
Python code of this video:
x = '2022-10-10' # Creating example date as string
print(x) # Print example date
# 2022-10-10
import datetime # Load datetime module
# AttributeError: module 'datetime' has no attribute 'strptime'
from datetime import datetime # Import datetime
print(x_new) # Print datetime object
Follow me on Social Media:
x = '2022-10-10' # Creating example date as string
print(x) # Print example date
# 2022-10-10
import datetime # Load datetime module
# AttributeError: module 'datetime' has no attribute 'strptime'
from datetime import datetime # Import datetime
print(x_new) # Print datetime object
Follow me on Social Media: