Saturday, January 28, 2017

Date and Time in Python :)

Tags

Python contains Library datetime which allows us to keep track of current Time and Date.
Following Program shows the usage of datetime Library:

from datetime import datetime  #importing datetime library
current=datetime.now();  #assigning variable to current date and time
print(current);



datetime.now() Function is used to get the current date and time.

Note: # keyword is used for Comments.