Search Postgresql Archives

Re: TIMESTAMP vs TIMESTAMP WITHOUT TIME ZONE

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

 



On Thu, Nov 10, 2005 at 04:37:36PM +0100, juleni@xxxxxxxxxxxx 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@xxxxxxxxx>   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: pgpRE2PJO7KeG.pgp
Description: PGP signature


[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