Grand Finale : Please Help!


#1

my code :
from datetime import datetime
now = datetime.now()

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

I dont know what's wrong :confused:


#2

Can you post your code in Preformatted text? it makes it easier to see any errors. :slight_smile:


#3

You need to put a comma ( , ) in between now.year and now.hour.


#4

Hey,I tried putting a comma but then I got an error saying : "Your printed date and time do not seem to be in the right format: mm/dd/yyyy hh:mm:ss "


#5

Well can you post your code in Preformatted text?
(I asked that earlier)


#6


#7

now.date

Replace it with now.day (because you need the day and not the date). let me know if that works. :slight_smile:


#8

Hey. That worked. Thank you so much. I was stuck with this code since an hour. PHEW
Cheers! Good day!


#9

That's great :smiley: Happy coding! :slight_smile:


#10

:smile: Happy Coding to you too!


#11

hey I have a doubt in the "NOT" part ,could you help?


#13


#14

I just found your post.


#15

okay ,so could you help?


#16

Yes, let me see what I can do.


#17

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