Stuck at date and time(grand finale)


#1

print '%s/%s/%s %s:%s:%s' % (now.month,now.day,now.year now.hour,now.minute,now,second).
please let me know my error


#2

Look at your parameter list again. Are you missing something ?


#3

maybe you missed the comma sign after now.year.


#4

In now.second, you put a comma instead of a period


#5

Here is the answer.

from datetime import datetime
now = datetime.now()

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


#6

from datetime import datetime
now = datetime.now()

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

one needs to put a space between first colon on second line


#7

This exercise seems ambiguous to me...Is the output supposed to be:
"mm/dd/yyyy hh:mm:ss"
Or is it supposed to be:
"hh:mm:ss"

It feels ambiguous because it can imply either adding the hh:mm:ss format to the prior exercise, or it can imply setting the string to only hh:mm:ss.

Turns out, it is supposed to be "hh:mm:ss" format. Therefore, for clarity I would suggest rewording the exercise from
Similar to the last exercise, print the current time in the pretty form of hh:mm:ss.
to
Similar to the last exercise, print the current time in the pretty form of hh:mm:ss. (the final output will not include mm/dd/yyyy; it will be only hh:mm:ss)