This is really two questions: 1st, are Epoch (Unix) timestamps the same on all machines (assuming their system clocks are correct), regardless of timezones?
I ask because I have code deployed to AWS Lambda that generates Epoch timestamps using the datetime module. When we extract the data, I am trying to convert to a local time string (also using datetime) and I am getting a 2 hour difference to what was expected. I then started testing the following code:
import datetime
import time
print(time.time()) #1
print(datetime.datetime.utcnow().timestamp()) #2
print#1: 1554747526.775873
print#2: 1554783526.775873
Running on my local machine, they are different by two hours. I deployed the above code to AWS Lambda and they return the same values. How is it different on my machine? The screenshot below shows the same code running on AWS Lambda (left) and my local machine. My system clock is correct.