From: dungdm93@live.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13691: Postgres reverse timezone system
Date: Wed, 21 Oct 2015 03:41:09 +0000
Message-ID: <20151021034109.3017.131@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13691
Logged by: Đặng Minh Dũng
Email address: dungdm93@live.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.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: dungdm93@live.com
Subject: Re: BUG #13691: Postgres reverse timezone system
In-Reply-To: <20151021034109.3017.131@wrigleys.postgresql.org>
References: <20151021034109.3017.131@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox