Answers for "python current clock time"

3

python get current time in seconds

import time
milliseconds = int(round(time.time() * 1000))
print(milliseconds)
Posted by: Guest on July-05-2020
2

clock in python

# Here is a self updating clock function, just run it and it'll self update itself until you hit CTRL-C
import datetime
import time
def clock():
    while True:
        print(datetime.datetime.now().strftime("%H:%M:%S"), end="r")
        time.sleep(1)

clock()
Posted by: Guest on July-23-2020

Python Answers by Framework

Browse Popular Code Answers by Language