Date and time


#1



https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/6?curriculum_id=4f89dab3d788890003000096#


Oops, try again. Your printed date and time do not seem to be in the right format: mm/dd/yyyy hh:mm:ss

it keeps saying theres something wrong with my date time etc. but I checked it over many times and didn't see what was wrong

from datetime import datetime
now = datetime.now()

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


#2

Hi, @inspired ,

Compare what you have with this format ...

mm/dd/yyyy hh:mm:ss

Your output should all be on a single line, and you need colons (:) rather than slashes (/) to separate the components of the time.


#3

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