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

preview_player
Показать описание
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:

Рекомендации по теме