Time


#1

Help me resolve this code.

from datetime import datetime
now = datetime.now()
print now.hour
print now.minute
print now.second

print ‘%02d:%02d-%04d’ % (now.hour,now.minute, now.second

i keep getting error

File “python”, line 6
print ‘%0:%0-%0’ % (now.hour,now.minute, now.second
^
SyntaxError: invalid syntax


#2

Missing a closing parenthesis on your argument tuple.


#3

print ‘%02d:%02d:%04d’ % (now.hour,now.minute, now.second) this code is not working,

print ‘%x:%s:%s’ % (now.hour, now.minute, now.second) this is working but i dont understand this code