Lab 3: Date and Time

Lab Description:

In this lab we had to write out the current years date and time in one sentence. We learned how to write the date first. After we learned how to write the date we learned how to write the time. After we wrote the time we had to both of them together like in the source code and screen shot. To separate them from each other after we entered the date in the last line we had to put a comma and the put in the time. In a lab like this it is very hard to do it perfectly. Your going to have a lot of mistakes that you will need to fix and take your time going through the lab and read all the instructions.

Code:

from datetime import datetime
now = datetime.now()
current_year = now.hour
current_year = now.minute
current_year = now.second
current_year = now.month
current_year = now.day
current_year + now.year
print str (now.month) + “/” + str (now.day) + “/” + str (now.year), str (now.hour) + “:” + str (now.minute) + “:” + str (now.second)

Screen shot:

kevin lab 3

Leave a Reply

Your email address will not be published. Required fields are marked *