Answers for "how to print time local time in python with time module"

1

python displaying the time

import datetime
now = datetime.datetime.now()
print ("Current date and time : ")
print (now.strftime("%Y-%m-%d %H:%M:%S"))
Posted by: Guest on March-02-2020
1

how to get the local time in python

from datetime import datetime
import time
now = datetime.now()
while True:
    print(now.strftime("local time :- %X"))
    time.sleep(2)
Posted by: Guest on October-03-2021

Code answers related to "how to print time local time in python with time module"

Python Answers by Framework

Browse Popular Code Answers by Language