AttributeError: module 'datetime' has no attribute 'datetime'

Viewed 33
import datetime

current_datetime_demo = datetime.datetime.today()
print(current_datetime_demo)

I am using pycharm to run this and it keeps throwing this error when i try to print date and time

1 Answers

if you already imported datetime library you should do

current_datetime_demo = datetime.today()
Related