In Python, to work with date and time, you have to import the datetime module. in datetime module there is a datetime object represents both date and time. If you want to get the current date and time of the system where you are running the Python program, use the method datetime.now(). Here is an example.
import datetime
print( datetime.datetime.now() )
See more Python Tips.
Reference
- More about datetime.datetime object at Python docs.