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

From Martijn van Oosterhout
Subject Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE
Date
Msg-id 20051110162039.GE19686@svana.org
Whole thread Raw
In response to TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE  (juleni@livetrade.cz)
List 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.

Attachment

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Best way to use indexes for partial match at
Next
From: Tom Lane
Date:
Subject: Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE