TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE

Поиск
Список
Период
Сортировка
От juleni@livetrade.cz
Тема TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Дата
Msg-id 69829538.20051110163736@livetrade.cz
обсуждение исходный текст
Ответы Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE  (Martijn van Oosterhout <kleptog@svana.org>)
Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE  (juleni@livetrade.cz)
Список pgsql-general
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.

Figure 1: (using pure TIMESTAMP type)
-------------------------------------
If  I  have  defined  column  as:
   my_date TIMESTAMP
and then I read current timestamp from the server (in USA) - it means I will use
LOCALTIMESTAMP,  I  will  receive at the client computer current timestamp value
from USA - e.g. 10:00 a.m. But in the Europe is time 17:00 (+ 7 hour) and maybe
this can cause problems.

Figure 2: (using pure TIMESTAMP WITH TIME ZONE type)
----------------------------------------------------
If  I  have  defined  column  as:
   my_date TIMESTAMP WITH TIME ZONE
and then I read current timestamp from the server (in USA) - it means I will use
CURRENT_TIMESTAMP  or  now(). Then I will receive at the client computer current
timestamp  value  from  USA  -  e.g.  10:00  a.m.  and  this timestamp will be
automatically  convrerted  to the correct time zone (17:00 in Europe) ? It means
when  I  send  it  back  from  europe  client to the usa server, it will be also
automatically converted to the usa timestamp?


   Is  that  right  or  I have didn't understand this behaviour? Is it better in
generally to use timestamp with time zone or timestamp without time zone?

   Thanks for answer,
   with best regards,

   Julian Legeny

mailto:juleni@livetrade.cz


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

Предыдущее
От: "Damjan Pipan"
Дата:
Сообщение: plpgsql using EXECUTE function
Следующее
От: David Rysdam
Дата:
Сообщение: [Fwd: I must not understand the permissions system]