From: | dungdm93(at)live(dot)com |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #13691: Postgres reverse timezone system |
Date: | 2015-10-21 03:41:09 |
Message-ID: | 20151021034109.3017.131@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 13691
Logged by: Đặng Minh Dũng
Email address: dungdm93(at)live(dot)com
PostgreSQL version: 9.4.4
Operating system: Microsoft Windows 7
Description:
I'm in Vietnam with timezone ICT (GMT+7).
I wanna find the best way to convert datetime between timezone like this:
postgres=# SELECT
postgres-# now() AS "NOW",
postgres-# now() AT TIME ZONE 'ICT' AS "ICT",
postgres-# now() AT TIME ZONE '+7:00' AS "+7:00",
postgres-# now() AT TIME ZONE 'UTC+7' AS "UTC+7",
postgres-# now() AT TIME ZONE 'UTC+7:00' AS "UTC+7:00",
postgres-# now() AT TIME ZONE 'GMT+7:00' AS "GMT+7:00";
-[ RECORD 1 ]------------------------
NOW | 2015-10-21 09:55:50.631+07
ICT | 2015-10-21 09:55:50.631
+7:00 | 2015-10-20 19:55:50.631
UTC+7 | 2015-10-20 19:55:50.631
UTC+7:00 | 2015-10-20 19:55:50.631
GMT+7:00 | 2015-10-20 19:55:50.631
As you can see, ICT and GMT+7:00 or +7:00 are identical, Unfortunately, the
query results are different. However, when i select:
SELECT now() AT TIME ZONE '-7:00' AS "-7:00";
The result is correct. So why Postgres reverse timezone system???
Thanks you.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2015-10-21 05:15:05 | Re: BUG #13691: Postgres reverse timezone system |
Previous Message | Michael Paquier | 2015-10-21 02:42:23 | Re: BUG #13657: Some kind of undetected deadlock between query and "startup process" on replica. |