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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: why at time zone tz_offset not equal tz_name? tz_name has same offset in pg_timezone_names
Дата
Msg-id CAKFQuwZgkaqZK5QNPceV090A4FW-PU384jbq_Tm6nt34-qeXYw@mail.gmail.com
обсуждение исходный текст
Ответ на 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
On Mon, Apr 28, 2025 at 7:40 PM H Witt <i5d@live.com> wrote:
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'

display
|2025-02-02 23:04:05.000|2025-02-03 15:04:05.000|

When you write the former you get the POSIX convention for sign meaning (+ == West).  When you write the latter you get the ISO convention (+ == East)


Since people expect ISO conventions you should stick to using the zone names and forget explicit offsets (and even the abbreviations for good measure) even exist.

David J.

В списке pgsql-novice по дате отправления: