Error in Data and Time 6 in Python course

from datetime import datetime
now =

print '%s/%s/%s %s:%s:%s' % (now.month,, month.year, now.hour, now.minute, now.second)

The above is the code I used and below is the error I receive. Any advice on what I am doing wrong?

Traceback (most recent call last):
File “python”, line 4, in
NameError: name ‘month’ is not defined



Hi @devpro63336,

let’s focus on this line here:

Did you see the error? What is month.year? Where did the instructions ask for that?


@intermediategamer thank you, I was focused on the first term (now.month) and overlooked the rest…:confounded:

Thanks for the help!


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