TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE

From: juleni(at)livetrade(dot)cz
To: pgsql-general(at)postgresql(dot)org
Subject: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Date: 2005-11-10 15:37:36
Message-ID: 69829538.20051110163736@livetrade.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)livetrade(dot)cz

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Rysdam 2005-11-10 15:45:04 [Fwd: I must not understand the permissions system]
Previous Message Scott Marlowe 2005-11-10 15:35:46 Re: Best way to use indexes for partial match at