The Grand Finale 6/6 Date and Time


#1


What am I doing wrong?


#2

The repeated code jumps out, right away. Two lines can be removed from the top. Going to try to test the (repaired) code but it would sure be easier if you pasted it in so we could capture it.

Edit:

Tested and passes.


#3

@hyperfool,
google search
== discussions / opinions=
python datetime.now() explained site:stackoverflow.com
= http://stackoverflow.com/questions/415511/how-to-get-current-time-in-python
= http://stackoverflow.com/questions/4071924/python-datetime-of-a-specific-timezone


#4

Also tested and passed...

from datetime import datetime

now = datetime.now()

now_tuple = (now.month,now.day,now.year,now.hour,now.minute,now.second)

now_format = "%s/%s/%s %s:%s:%s"

print now_format % now_tuple

#5

OR in different format...

from datetime import datetime

now = datetime.now()

now_tuple = (now.month,now.day,now.year,now.hour,now.minute,now.second)

now_format =  "%s/%s/%s %d:%02d:%02d"

print now_format % now_tuple

#6

Hello I was also having problems with the date time grand finale so I see that the code you wrote works, but I don't understand the tuple because the instructions never mention that part of the tuple. can you please explain your way. thank you


#7

Python 5.3 Tuples and Sequences


#8

Sir, can you give us your version to explain tuple? Kindly APPRECIATED!


#9

What part of the above documentation do you not understand? I don't have my own version since the docs are largely sufficient explanation. What can I add?


#10

no problem sir. i understand!


#12

I was doing the same thing... use now.day instead of now.date and it will work.


#13

A post was split to a new topic: Not in the right time format?


#14