On Thu, Jan 18, 2024 at 11:31 AM Andrey Borodin <x4...@yandex-team.ru> wrote:
> > Now I'm completely lost in time... I've set local time to NY (UTC-5). > > postgres=# select TIMESTAMP WITH TIME ZONE '2022-02-22 14:22:22-05' - > TIMESTAMP WITH TIME ZONE 'Tuesday, February 22, 2022 2:22:22.00 PM > GMT-05:00'; > ?column? > ---------- > 10:00:00 > (1 row) > > You are mixing POSIX and ISO-8601 conventions and, as noted in our appendix, they disagree on the direction that is positive. https://www.postgresql.org/docs/current/datetime-posix-timezone-specs.html The offset fields specify the hours, and optionally minutes and seconds, difference from UTC. They have the format hh[:mm[:ss]] optionally with a leading sign (+ or -). The positive sign is used for zones west of Greenwich. (Note that this is the opposite of the ISO-8601 sign convention used elsewhere in PostgreSQL.) David J.