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.