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

1

python print time

import datetime
now = datetime.datetime.now()
print (now.strftime("%Y-%m-%d %H:%M:%S"))
# key: https://strftime.org/
Posted by: Guest on March-17-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"

Python Answers by Framework

Browse Popular Code Answers by Language