To get the current date and time in python, use the following code:
>>> import datetime
>>> datetime.datetime.now()
datetime(2018, 1, 6, 15, 8, 24, 78915)
>>> print(datetime.datetime.now())
2018-10-03 09:17:13.812189
And to get only the time, use the following code:
>>> datetime.datetime.time(datetime.datetime.now())
datetime.time(15, 8, 24, 78915)
>>> print(datetime.datetime.time(datetime.datetime.now()))
09:17:51.914526