How do I get the current time in Python? - Stack Overflow
https://stackoverflow.com/questions/415511/how-do-i-get-the-current-time-in-python
WEBAug 14, 2021 at 14:26. 54 Answers. Sorted by: 3906. Use datetime: >>> import datetime. >>> now = datetime.datetime.now() datetime.datetime(2009, 1, 6, 15, 8, 24, 78915) >>> print(now) 2009-01-06 15:08:24.789150. For just the clock time without the date: >>> now.time() datetime.time(15, 8, 24, 78915) >>> print(now.time()) 15:08:24.789150.
DA: 61 PA: 58 MOZ Rank: 37