Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names - Mailing list pgsql-novice

From Tom Lane
Subject Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
Date
Msg-id 945499.1745896055@sss.pgh.pa.us
Whole thread Raw
In response to why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names  (H Witt <i5d@live.com>)
List pgsql-novice
H Witt <i5d@live.com> writes:
> select
> '2025-02-03 15:04:05'::timestamptz at time zone '+08:00',
> '2025-02-03 15:04:05'::timestamptz at time zone 'Asia/Shanghai'

They're different because '+08:00' is read as a POSIX time zone
specification, which has the opposite sign convention to what
you are thinking.  See

https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-TIMEZONES

and especially

https://www.postgresql.org/docs/current/datetime-posix-timezone-specs.html

and remember the adage "The great thing about standards is there are
so many to choose from".  Sadly, with only two relevant standards
humanity has still managed to cover the design space of which
direction from Greenwich gets the positive sign.

            regards, tom lane



pgsql-novice by date:

Previous
From: H Witt
Date:
Subject: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
Next
From: "David G. Johnston"
Date:
Subject: Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names