First, created a new table named test_timestamp that has a TIMESTAMP column: t1;
CREATE TABLE test_timestamp (
t1 TIMESTAMP
);
Second, set the session’s time zone to ‘+00:00’ UTC by using the SET time_zone statement.
SET time_zone='+00:00';
Third, insert a TIMESTAMP value into the test_timestamp table.
INSERT INTO test_timestamp(t1) VALUES('2008-01-01 00:00:01');
Fourth, select the TIMESTAMP value from the test_timestamp table.
SELECT t1 FROM test_timestamp;
Fifth, set the session’s time zone to a different time zone to see what value we will get from the database server:
SET time_zone ='+03:00';
Finally, query data from the table:
SELECT t1 FROM test_timestamp;
MySQL Timestamp timezone changes
As you see, we received a different time value adjusted to the new time zone.