Re: AT TIME ZONE correction

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: AT TIME ZONE correction
Дата
Msg-id 14024.1535912518@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: AT TIME ZONE correction  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: AT TIME ZONE correction  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-docs
Bruce Momjian <bruce@momjian.us> writes:
> !     The <literal>AT TIME ZONE</literal> construct allows the addition,
> !     conversion, and removal of time zones for time stamp values.  <xref
>       linkend="functions-datetime-zoneconvert-table"/> shows its
>       variants.

Maybe it'd be more to the point to say that it allows conversion between
"timestamp with time zone" and "timestamp without time zone".

> !     The first example takes a time stamp without time zone and interprets
> !     it in the MST time zone (UTC-7), returning a time stamp with time
> !     zone value which is displayed in local time (PST, UTC-8).  The second
> !     example takes a time stamp with time zone value (EST, UTC-5) and
> !     converts it to the date and time in MST (UTC-7) without time zone.
> !     Basically, the first example takes the date and time and puts it in
> !     the specified time zone.  The second example takes a time stamp with
> !     time zone and shifts it to the specified time zone. (No time zone
> !     designation is returned.)

I still find this to be more confusing than helpful.  In particular,
I do not think that it's possible to explain this behavior clearly
without mentioning that timestamp with time zone values are always
stored in UTC and what AT TIME ZONE really does is convert between UTC
and the specified zone (in a direction dependent on which type is
supplied as argument).

            regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: AT TIME ZONE correction
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: AT TIME ZONE correction