4.Hot Date


#1

4.Hot Date

Oops, try again. Your printed date doesn't seem to be in the proper format: mm/dd/yyyy.

from datetime import datetime
now = datetime.now()

print '%s-%s-%s' % (now.month,now.day,now.year)

#2

@bella2014,

Have a close look at

mm/dd/yyyy

and your

'%s-%s-%s'


#3

hey it is not working why


#4

Hi don't post on an old post 1 month later if you need help it's better if your create a new topic with your code.


#5

@coltonninja could you post your code for me to look at?


#6

sure here it is from datetime import datetime
now = datetime.now()
print '02/19/2014' % (now.year, now.month, now.day)


#7

im sorry i did not see it


#8

Don't worry just next time create a new topic

then

print '02/19/2014' % (now.year, now.month, now.day)

where you put '02/19/2014' you should put '%s/%s/%s' then here

(now.year, now.month, now.day)

it should be on that order mm/dd/yyyy
hope that could help you


#9

from datetime import datetime
now = datetime.now()

print "%s" + "/" + "%s" + "/" + "%s" % (now.month, now.day, now.year)

this is my code. Its saying that not all arguments converted during string formatting

PLS HELP PLS PLS


#10

HI this line

print "%s" + "/" + "%s" + "/" + "%s" % (now.month, now.day, now.year)

this part

"%s" + "/" + "%s" + "/" + "%s"

remove the +(s) then put it like that

"%s/%s/%s"

#11

ok thx i will do it next time


#12

from datetime import datetime
now = datetime.now()

print '%s/%s/%s' % (now.month, now.day, now.year)

#13

hi thank you for your help


#14

#15

This topic is old, if you still have problems make a new topic