4.Hot Date

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)


@bella2014,
######Have a close look at
#mm/dd/yyyy
and your

‘%s-%s-%s’

hey it is not working why

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.

1 Like

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

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

1 Like

im sorry i did not see it

1 Like

Don’t worry just next time create a new topic

#then
this line on your

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

1 Like

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

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"
1 Like

ok thx i will do it next time

from datetime import datetime
now = datetime.now()

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

hi thank you for your help

2 Likes

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