How To Check Current Time Using Python


In this post we are going to learn how we can check the time using Python. In this program, we do not install any module because in this program, we have the preinstalled modules in our computer. The module name is datetime only we have to import the datetime module. 

Here is the code:

from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)

We will meet again in another post. Stay Safe, Keep Learning.

Post a Comment

Previous Post Next Post