Confused About Getting the Current Date and Time Exercise


#1



I'm stuck with this.
https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/2?curriculum_id=4f89dab3d788890003000096#


This is the error message.

script.py
Traceback (most recent call last):
File "python", line 2, in
TypeError: can't set attributes of built-in/extension type 'datetime.datetime'


from datetime import datetime
datetime.now= "05 01 2017"
now = datetime.now

print str(datetime.now)
print now

I'm really stuck on this error. Can anyone give me an additional clue?


#2

i think in the information is a pretty good hint:

from datetime import datetime

print datetime.now()

now() is a method, use it as such. It will fetch the current date and time, no need to type that in manual


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.