MySQL Test Timezone Script

 CREATE TABLE tzt(
id MEDIUMINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
ts TIMESTAMP NOT NULL,
dt DATETIME NOT NULL
);

SELECT @@global.time_zone, @@session.time_zone;


SET GLOBAL time_zone = 'Asia/Jerusalem';
SET SESSION time_zone = 'Asia/Jerusalem';

INSERT INTO tzt SET ts='2021-08-22 13:30:00', dt='2021-08-22 13:30:00';

SELECT * FROM tzt\G

SET GLOBAL time_zone = 'America/Sao_Paulo';
SET SESSION time_zone = 'America/Sao_Paulo';


SELECT * FROM tzt\G

No comments:

Post a Comment

Setting program_name in mysql session_connect_attrs allows you to see the name of the program connected

I am using mysql for quite some time now. I have noticed that looking at client connections using mysql workbench so an interesting column ...