Re: TIMESTAMP WITHOUT TIME ZONE

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: TIMESTAMP WITHOUT TIME ZONE
Дата
Msg-id 20061215223322.GZ14237@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: TIMESTAMP WITHOUT TIME ZONE  (Richard Troy <rtroy@ScienceTools.com>)
Список pgsql-general
Richard Troy wrote:

> I'd appreciate a clean yes/no;  From a Java application, throught PG in
> both directions, the same timestamp comes back that was handed to the JDBC
> driver so long as it's stored in a "timestamp without time zone"
> attribute, nomatter neither where on earth the insert/update originates,
> nor where the select originates? Same bits, yes? Otherwise, "Houston,
> we've got a problem."

If you pass a timestamp without time zone, the given timestamp will be
given back to you on request, no changes applied, whatever the timezone
either the inserter or the extracter are on.

If you pass a timestamp with time zone, the time will be rotated to UTC
on insert depending on the inserter's timezone (thus it's stored as
UTC), and will be rotated "back" to the extracter's timezone when you
extract it.  Note that both timezones may be different, so the numbers
you get may be different than the numbers you put in, but they will
signal exactly the same instant in time (in the appropriate time zone).

If you want to know what time zone the inserter used, you would store
that in a separate column.

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

Предыдущее
От: Richard Troy
Дата:
Сообщение: Re: TIMESTAMP WITHOUT TIME ZONE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TIMESTAMP WITHOUT TIME ZONE