[Python dealing with UTC timestamps] 2020-03-27 It seems this method is accurate because it explicitly specifies UTC time. #pyhton #time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
# get UTC timestamp in seconds | |
datetime_utc_origin = datetime.datetime(1970, 1, 1) | |
# now | |
utc_timestamp_now = (datetime.datetime.utcnow() - datetime_utc_origin).total_seconds() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment