update
This commit is contained in:
10
PostgreSQL/time.sql
Normal file
10
PostgreSQL/time.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- 设置会话时区
|
||||
SET TIME ZONE 'Asia/Shanghai';
|
||||
|
||||
-- msg_time 是 timestamptz类型
|
||||
select msg_time from msg where id = 1;
|
||||
select msg_time AT TIME ZONE 'Asia/Shanghai' from msg where id = 1;
|
||||
select msg_time AT TIME ZONE 'UTC+8' from msg where id = 1;
|
||||
|
||||
SELECT to_timestamp(1761850339);
|
||||
SELECT to_timestamp(1761850339) AT TIME ZONE 'Asia/Shanghai';
|
||||
Reference in New Issue
Block a user