X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0B1F611F61C5 for ; Tue, 11 Apr 2006 20:54:02 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 2.301 X-Spam-Level: ** X-Spam-Status: No, score=2.301 required=5 tests=[AWL=-0.497, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44, DNS_FROM_RFC_WHOIS=0.879] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id xxCkeuEUmDE7 for ; Tue, 11 Apr 2006 20:53:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing2.us4.outblaze.com [205.158.62.67]) by postgresql.org (Postfix) with ESMTP id 3509B11F6009 for ; Tue, 11 Apr 2006 20:53:56 -0300 (ADT) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id 5BBBE1800D59 for ; Tue, 11 Apr 2006 23:53:55 +0000 (GMT) X-OB-Received: from unknown (208.36.123.31) by wfilter.us4.outblaze.com; 11 Apr 2006 23:53:22 -0000 Received: by ws7-2.us4.outblaze.com (Postfix, from userid 1001) id 4392FE5BC7; Tue, 11 Apr 2006 23:53:55 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Wei Wei" To: "Kris Jurka" Cc: pgsql-jdbc@postgresql.org Date: Tue, 11 Apr 2006 15:53:55 -0800 Subject: Re: Calendar vs. Timestamp Received: from [24.87.9.157] by ws7-2.us4.outblaze.com with http for wei725@lycos.com; Tue, 11 Apr 2006 15:53:55 -0800 X-Originating-Ip: 24.87.9.157 X-Originating-Server: ws7-2.us4.outblaze.com Message-Id: <20060411235355.4392FE5BC7@ws7-2.us4.outblaze.com> X-Archive-Number: 200604/87 X-Sequence-Number: 15021 > > I would like to clarify one observation. The timestamp seems only=20 > > take the date section data of a calendar object regardless the=20 > > value of the time zone. If so, a calendar object with a specified=20 > > time zone would not make any difference in comparsion to a=20 > > calendar object with the default time zone. Or, the default time=20 > > zone is always used in PG. > > >=20 > I think the confusion arises from the fact that the server always=20 > stores timestamps in utc and always returns them based upon the=20 > current setting of the TimeZone configuration parameter. >=20 > CREATE TABLE tstest(a timestamptz); > INSERT INTO tstest VALUES ('2006-04-11 16:15:28-07'); > INSERT INTO tstest VALUES ('2006-04-11 16:15:28-08'); > SET TimeZone =3D 'America/Los_Angeles'; > INSERT INTO tstest VALUES ('2006-04-11 16:15:28'); > SELECT * FROM tstest; 2006-04-11 16:15:28-07 2006-04-11 17:15:28-07 2006-04-11 16:15:28-07 > SET TimeZone =3D 'America/New_York'; > INSERT INTO tstest VALUES ('2006-04-11 16:15:28'); > SELECT * FROM tstest; >=20 2006-04-11 19:15:28-04 2006-04-11 20:15:28-04 2006-04-11 19:15:28-04 2006-04-11 16:15:28-04 > Thanks for the test code to clarify the time zone matter. I need to change = my approach to show the date & time with the users' time zones. --=20 _______________________________________________ Search for businesses by name, location, or phone number. -Lycos Yellow Pa= ges http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.as= p?SRC=3Dlycos10