Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
Дата
Msg-id 945499.1745896055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names  (H Witt <i5d@live.com>)
Список 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 по дате отправления: