hubble时区设置 为客户端session级别设置
set timezone='Asia/Shanghai';
root-hubble01:35432/defaultdb> set timezone='Asia/Shanghai';
SET
Time: 0ms total (execution 0ms / network 0ms)
SHOW TIME ZONE;
root@poc-hubble01:35432/defaultdb> SHOW TIME ZONE;
timezone
-----------------
Asia/Shanghai
(1 row)
select now();
root@poc-hubble01:35432/defaultdb> select now();
now
---------------------------------
2022-03-21 13:50:22.843663+08
(1 row)
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
public static void main(String[] args) {
// TODO Auto-generated method stub
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
try {
Class.forName('org.postgresql.Driver');
Connection con = DriverManager.getConnection(url, user, password);
} catch (Exception e) {
// TODO: handle exception
}
}
-Duser.timezone=Asia/Shanghai
打开dbeaver.ini,添加下列高亮行
-Duser.timezone=Asia/Shanghai
-Dosgi.requiredJavaVersion=11
-Xms64m
-Xmx1024m
-Duser.timezone=Asia/Shanghai
-Ddbeaver.distribution.type=exe