I did some research and discovered that UNIX 'epoch' time is in UTC, "Universal Time Coordinated". Though technically UTC is not a time zone but GMT is, UTC converts directly to UTC, and can be easily converted to any local time zone. See here for more detail.
To confirm this, I used Remix to deploy and run a simple smart contract using Rinkeby, an Ethereum test network. My smart contract simply requests the current time by using `block.timestamp' and allows the value to be queried:
pragma solidity ^0.5.2;
contract NowContract {
uint32 public nowValue = 0;
constructor () public NowContract() {
computeNow();
}
function computeNow() public {
nowValue = uint32(block.timestamp);
}
}
At right about 5 PM on 3/7/2019 in California (PDT), I called computeNow
and then inspected nowValue
. I got back the value 1552006848
which I then fed in to this site to convert it to a date. I got back:
03/08/2019 @ 1:00am (UTC)
It is easily verified that 3/7/2019 @5:00pm (PDT) is the same as 03/08/2019 @ 1:00am (UTC).
Moral of the story: As one would hope, when building blockchain applications that need to have awareness of the current date/time, you can be sure that no matter where your smart contract code runs, the result is always in UTC.