Grand Finale Error


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

Giving me the above error I don't know whats wrong with the code any help welcome

from datetime import datetime
now =

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


Hi @masteranonymous007 ,

Compare the format of your output with the format specified in the instructions and in the message.

The required output format is ...

mm/dd/yyyy hh:mm:ss

Note the specified placement of slashes and colons.

Currently, your format string is ...

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


But everything seems right the slashes and colons are also in the correct places. the date is 08/09/2016 which is in my output. I actually cannot find anything wrong with it.


@masteranonymous007 ,

Yes, as you point out, the current date is 08/09/2016.
But in the console, you have it output as 08/09/2016/.

Check the format of the time, as well.


Ah I see. I will try and inform you in a second


Worked. Yup I put an extra slash and colon I thought it had to be after each string. Thanks


But why do you not put a slash or colon on the last string?


Hi @masteranonymous007 ,

In dates and times, slashes and colons, respectively, are used to separate the components, but not to terminate them. Therefore, they are not needed after the final components of dates and times.


That clears it up cheers lad


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