タイムゾーン設定

(8.0.21)
https://qiita.com/tailak/items/63dce2dd7dfe049b038e
https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html


vim /etc/my.cnf
default-time-zone='+00:00'


select @@time_zone;
show variables like '%time_zone%';

select now();


system_time_zone: OSから引き継いだタイムゾーン
time_zone: 実際に使用するタイムゾーン

(12cR1)
https://qiita.com/tpusuke/items/c424fe771cd973d5299e
https://www.atmarkit.co.jp/ait/articles/0505/27/news116.html

原則としてOSのタイムゾーンを引き継ぐ。パラメータでの変更はできない模様


※DBTIMEZONEは「TIMESTAMP WITH LOCAL TIME ZONE型」のデータ格納時にだけ使用する
select DBTIMEZONE from dual;
alter database set time_zone='+00:00';
shutdown immediate;
startup

select systimestamp from dual;

→DBTIMEZONEを変更しても変化しない

Grid InfrastructureやSchedulerは個別の設定がある

 

(9.4)
https://qiita.com/zkangaroo/items/93be2d4504c3d1d5f185


--タイムゾーン確認
SELECT * FROM pg_timezone_names;

vim postgresql.conf
timezone = 'America/New_York'


show timezone;

select clock_timestamp();

 

(2014)

OSのタイムゾーンを引き継ぐ。パラメータでの変更はできない模様