Python Convert Current Local Time to UTC Time

Pubblicato il: 18 gennaio 2018
sul canale di: OSPY
2,886
11

Python How to Convert Current Local Time to UTC Time
import datetime
import time
current_local_time = datetime.datetime.now()
print "Current Local Time: ", current_local_time

current_utc_time = datetime.datetime.utcnow()
print "Current UTC Time: ", current_utc_time

##Local Time to UTC Time
current_local_time_timestamp = current_local_time.strftime("%s")
print "current_local_time_timestamp: ", current_local_time_timestamp

print "Current Local Time to UTC Time: ", datetime.datetime.utcfromtimestamp(float(current_local_time_timestamp))


In questa pagina del sito puoi guardare il video online Python Convert Current Local Time to UTC Time della durata di ore minuti seconda in buona qualità , che l'utente ha caricato OSPY 18 gennaio 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 2,886 volte e gli è piaciuto 11 spettatori. Buona visione!