Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Дата
Msg-id 20051110162039.GE19686@svana.org
обсуждение исходный текст
Ответ на TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE  (juleni@livetrade.cz)
Список pgsql-general
On Thu, Nov 10, 2005 at 04:37:36PM +0100, juleni@livetrade.cz wrote:
> Hello,
>
>  I have question about functionality for TIMESTAMP (with/without time zone).
>  The  main  question  is,  what is better for usage: timemestamp WITH or WITHOUT
>  time zone?
>
>  I have e.g. server in USA and there is 6:00 a.m. Then I have client somwhere in
>  Europe (+7 hour) and I read timestamp from server in USA.

They serve different purposes. A timestamp without timezone is for
storing times values you want to appear the same to everyone no matter
where they are. A timestamp with timezone reprentents and instant in
time and will be converted to the time appropriate for the local user.

So it all depends on what you want. You can convert between them:

  my_timestamp_with_timezone AT TIME ZONE 'Europe/Amsterdam'

returns that the wallclock time of that timestamp as it was in
Amsterdam then.

The other way works too.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Best way to use indexes for partial match at
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE