Lab 3: Date & Time

Description:

Through the use of strings, we are able to program the date and time into Python.

 

 

Code:

This is the sample code.

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

 

 

Screenshot:

This is the screenshot of the code.

.Screen Shot 2013-10-16 at 11.22.01 PM

Leave a Reply

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