“temps temps()” Réponses codées

horloge 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()
Random boi

Python - temps universel oordonné

from datetime import datetime, timezone
print(datetime.now())              # timezone
print(datetime.now(timezone.utc))  # coordinated universal time 
Andrea Perlato

Python Time Library

#also see datetime
import time
now = time.time()
print(now)
Dr. Hippo

temps temps()

from time import time

# 1 January 1970 is the standard date that all computers measure time against 
# Prints the number of seconds that have passed since 1 January 1970
print(time())
_fresh_

Réponses similaires à “temps temps()”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code