TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE - Mailing list pgsql-general

From juleni@livetrade.cz
Subject TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Date
Msg-id 69829538.20051110163736@livetrade.cz
Whole thread Raw
Responses Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
List 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 by date:

Previous
From: "Damjan Pipan"
Date:
Subject: plpgsql using EXECUTE function
Next
From: David Rysdam
Date:
Subject: [Fwd: I must not understand the permissions system]