Re: Converting to UTC multiple times converts back to local time zone

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Converting to UTC multiple times converts back to local time zone
Дата
Msg-id 22011.1529974341@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Converting to UTC multiple times converts back to local time zone  (Gary Bernhardt <gary.bernhardt@gmail.com>)
Список pgsql-bugs
Gary Bernhardt <gary.bernhardt@gmail.com> writes:
> ... But I would never expect the value to switch back to
> local time when I add "AT TIME ZONE 'utc'".

It might help to understand that there's a difference between what
is stored and what is displayed.  For type timestamptz, what is
stored is an absolute point in time --- effectively "in UTC", though
I'm not sure that's the best way to think about it.  But for display
purposes, it's rotated into your session TimeZone setting.  That's
why an AT TIME ZONE conversion might appear to produce no change ---
the display conversion reverses what AT TIME ZONE did.

            regards, tom lane


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

Предыдущее
От: Gary Bernhardt
Дата:
Сообщение: Re: Converting to UTC multiple times converts back to local time zone
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Converting to UTC multiple times converts back to local time zone