Re: Inconsistent 'at time zone' conversion - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Inconsistent 'at time zone' conversion
Date
Msg-id CAKFQuwa-VxQdeXK=KOQSTdk9QMwo6dDOoRH3Cv97mc9V-5=H9Q@mail.gmail.com
Whole thread Raw
In response to Inconsistent 'at time zone' conversion  (Umut TEKİN <umuttechin@gmail.com>)
List pgsql-bugs
On Sun, Feb 19, 2023 at 4:10 PM Umut TEKİN <umuttechin@gmail.com> wrote:
I think I found a bug about time zones.

Nope, the observed behavior is documented.

1. select now();
2023-02-19 21:52:12.537849+00

2. select now()::timestamp with time zone  at time zone 'America/Denver';
2023-02-19 14:52:12.5383

3. select now()::timestamp with time zone at time zone 'UTC-7';
2023-02-20 04:52:12.538804

In America/Denver, UTC-7 is using as time zone that is why 1st and 2nd queries confirm each other, but 3rd query completely disapproves first two queries. Instead of '2023-02-19 14:52:12.538804', it shows '2023-02-20 04:52:12.538804'.

Unfortunately the actual +/- direction convention in use here is not the one you are expecting.  It is defined to be the reverse of what you've said, and so you get the observed behavior.

David J.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17795: Erroneous parsing of floating-poing components in DecodeISO8601Interval()
Next
From: Tom Lane
Date:
Subject: Re: Inconsistent 'at time zone' conversion