Lab 3: Date and Time

Description:

This code displays the current date and time of it creation or it use.

 

Code:

from datetime import datetime
now = datetime.now()

print ‘%s/%s/%s %s:%s:%s’ % (now.month, now.day, now.year, now.hour, now.minute, now.second)

 

Screenshot:

 

Capture

 

Leave a Reply

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