pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Time conversion across various parts of world
3+ messages / 3 participants
[nested] [flat]

* Time conversion across various parts of world
@ 2004-11-26 07:05 deepthi@granwill.com
  2004-11-26 07:12 ` Re: Time conversion across various parts of world John R Pierce <pierce@hogranch.com>
  0 siblings, 1 reply; 3+ messages in thread

From: deepthi@granwill.com @ 2004-11-26 07:05 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

For example, our website is running on a server located in Japan and we have
another website #2 running in US. our database is located on the server in
Japan. when some one accesses our website #2 which is located in US, the time
at which the user accessed our website #2 has to be registered in a database
which is situated in Japan. but at present i am getting the system time of the
server which is in japan.  How can i convert this time or get the corresponding
time at US using pgsql time zone feature or if anything else.

Please note: Our other website#2 can be located in other parts of the world
also, it need not be US only. I have the country name where our  website#2 is
located and by using this name i need to get the time in that country.

we are using postgresql 7.3.4.

Eagerly waiting for replies.

Thanking you,
deepthi





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Time conversion across various parts of world
  2004-11-26 07:05 Time conversion across various parts of world deepthi@granwill.com
@ 2004-11-26 07:12 ` John R Pierce <pierce@hogranch.com>
  2004-11-26 18:17   ` Re: Time conversion across various parts of world Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: John R Pierce @ 2004-11-26 07:12 UTC (permalink / raw)
  To: deepthi@granwill.com; +Cc: pgsql-jdbc

deepthi@granwill.com wrote:
> Hello,
> 
> For example, our website is running on a server located in Japan and we have
> another website #2 running in US. our database is located on the server in
> Japan. when some one accesses our website #2 which is located in US, the time
> at which the user accessed our website #2 has to be registered in a database
> which is situated in Japan. but at present i am getting the system time of the
> server which is in japan.  How can i convert this time or get the corresponding
> time at US using pgsql time zone feature or if anything else.
> 
> Please note: Our other website#2 can be located in other parts of the world
> also, it need not be US only. I have the country name where our  website#2 is
> located and by using this name i need to get the time in that country.

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Time conversion across various parts of world
  2004-11-26 07:05 Time conversion across various parts of world deepthi@granwill.com
  2004-11-26 07:12 ` Re: Time conversion across various parts of world John R Pierce <pierce@hogranch.com>
@ 2004-11-26 18:17   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2004-11-26 18:17 UTC (permalink / raw)
  To: John R Pierce <pierce@hogranch.com>; +Cc: deepthi@granwill.com; pgsql-jdbc

John R Pierce <pierce@hogranch.com> writes:
> deepthi@granwill.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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-11-26 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-26 07:05 Time conversion across various parts of world deepthi@granwill.com
2004-11-26 07:12 ` John R Pierce <pierce@hogranch.com>
2004-11-26 18:17   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox