Python Convert Current Local Time to UTC Time

preview_player
Показать описание
Python How to Convert Current Local Time to UTC Time
import datetime
import time
print "Current Local Time: ", current_local_time

print "Current UTC Time: ", current_utc_time

##Local Time to UTC Time
print "current_local_time_timestamp: ", current_local_time_timestamp

Рекомендации по теме
Комментарии
Автор

Really helpful! Was a little hard to understand though.

BytesandBotsLabs
Автор

strftime("%s") is giving Invalid format string error

parthadebnath
Автор

Hi, It's not working in anaconda2.7. It shows the following error

File "<ipython-input-71-72f8c9c350a1>", line 1, in <module>
current_local_time_timestamp =

ValueError: Invalid format string


I am also interested to know how we can convert a column of time (no date, loaded from a CSV file, series format) to UTC. Can you help me to do that?

akhilraj