<s>[INST] How to get current time in Python What is the module/method used to get current time?
 [/INST] >>> import datetime
>>> datetime.datetime.now()
datetime(2009, 1, 6, 15, 8, 24, 78915)

And just the time:
>>> datetime.datetime.time(datetime.datetime.now())
datetime.time(15, 8, 24, 78915)

The same but slightly more compact:
>>> datetime.datetime.now().time()

See the documentation for more info.
To save typing, you can import the datetime object from the datetime module:
>>> from datetime import datetime

Then remove the leading datetime. from all the above.
 </s>