how to get the local time in python

import datetime
datetime.datetime.now()
datetime.datetime(2009, 1, 6, 15, 8, 24, 78915)

print(datetime.datetime.now())
#2009-01-06 15:08:24.789150

Here is what the above code is Doing:
1. datetime.datetime.now() is a function that returns the current local date and time.
2. datetime.datetime(2009, 1, 6, 15, 8, 24, 78915) is a datetime object that represents a specific moment in time.
3. print(datetime.datetime.now()) prints the current local date and time.
4. #2009-01-06 15:08:24.789150 is a comment that explains what the code does.