Skip site navigation (1) Skip section navigation (2)

Re: Time conversion across various parts of world

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: deepthi(at)granwill(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Time conversion across various parts of world
Date: 2004-11-26 18:17:26
Message-ID: 10152.1101493046@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
John R Pierce <pierce(at)hogranch(dot)com> writes:
> deepthi(at)granwill(dot)com wrote:
>> How can i convert this time or get the corresponding
>> time at US using pgsql time zone feature or if anything else.

> store GMT in the database always, convert back to local time when you
> display it.

Note that the TIMESTAMP WITH TIME ZONE datatype effectively does that
for you.  The only thing you need to do is SET TIMEZONE to the
appropriate timezone for data entry or display.  The server's timezone
is really entirely irrelevant, except that it sets the initial default
value for the TIMEZONE setting.

			regards, tom lane

In response to

pgsql-jdbc by date

Next:From: Manuel SugawaraDate: 2004-11-26 19:33:29
Subject: Re: Result set not positioned properly, perhaps you need to
Previous:From: John R PierceDate: 2004-11-26 07:12:15
Subject: Re: Time conversion across various parts of world

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group