Date and Time | Grand Finale


Oops, try again. Your printed date and time do not seem to be in the right format: mm/dd/yyyy hh:mm:ss
but in the operator it say's this: 9-22-2016 18:28:32

it doesn't work... i didn't know why...

from datetime import datetime
now =

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


The instruction says:

Put slashes and colons and a space between the placeholders so that they fit the format above.

And this is a sample.

'%s/%s/%s %s:%s:%s'



In your code you have 9-22-2016, the format is 9/22/2016.
Just change in your code - to /.

Hope that helps.


Thanks!!! it was a stupid mistake but now it is good!


Now you won't forget - its all in the details.


A post was split to a new topic: Date time grand finale


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