Search Postgresql Archives

TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux