Date & Time error


error: Your printed date and time do not seem to be in the right format: mm/dd/yyyy hh:mm:ss

I'm sure that I did what it told me to do
Print the date and time together in the form: mm/dd/yyyy hh:mm:ss.

from datetime import datetime
now =

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


The instructions indicate that it all needs to be on one line.


You have to print all of it in one line and also the the slashes in month,day and years. All that put together the code will be:

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


Oh thank you, I tried that but I guess i got it wrong because I did : when changing between mm/dd/yyy and hms


Yah, good thing u got it now


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