最近埃及更改了DST规则,我对Postgres有一个问题,因为函数now()
返回了错误的时区.
我的时区是Africa/Cairo,现在是+3:00
,但Postgres返回+2:00
select now();
返回:
2023-05-05 22:17:06.461 +0200
应该是:
2023-05-05 23:17:06.461 +0300
My Postgres is containerized.
Time on the host: Fri May 5 23:19:26 EEST 2023
(correct).
Time in the Postgres container: Fri 05 May 2023 11:22:00 PM EEST
(correct).
timezone
在Postgres中的配置正确:
show timezone; -- returns Africa/Cairo
‘非洲/ cairo ’的timezone
表格条目为+3:00:
select * from pg_timezone_names
where name = 'Africa/Cairo';`
返回:
Africa/Cairo EEST 03:00:00 true
Postgres版本:
PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
我不知道为什么now()没有像预期的那样工作.