โ09-23-2021 12:49 AM
โ09-23-2021 02:59 AM
from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)
โ09-27-2021 12:54 AM
I'd suggest using datetime.utcnow() to avoid any issues with local times, especially if it's going into a library which needs unit testing.
โ09-27-2021 12:58 AM
Thank you @Darren Fullerโ
never-displayed
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.