Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6D72C9FA344 for ; Wed, 13 Dec 2006 07:47:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 45295-01 for ; Wed, 13 Dec 2006 07:47:20 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from web60525.mail.yahoo.com (web60525.mail.yahoo.com [209.73.178.173]) by postgresql.org (Postfix) with SMTP id 1EF2C9FA0EF for ; Wed, 13 Dec 2006 07:47:20 -0400 (AST) Received: (qmail 303 invoked by uid 60001); 13 Dec 2006 11:47:18 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=Wpsr7yytura8s2nkOW/OKXcGkI32sIUHYBoLOWbp08mfLb5XfQ0+Kp6oNtTNQXbmqhxkThrHEVH2INo9kbYawKnQKr5Bv18VJDytfeQQ0GV3osnxeRTqBjrYxz6K0s0PlQvgvs0NyiZJAHbPrP0lY0blBhSbvs+LtgNw4EW7ljU=; X-YMail-OSG: Np2NsmAVM1mbocYXCBIqRPx6gPMnRu4.Ij8_QKnteBiujkqSWOpOIJcY0zuv8PpboO4Ue8hjJjTbPx7rJ.BzU8Qd3b8q0fiPGYJ9DEv5htThxpAhN5vHdTVuMVI5cCOwcumf4SdR1_RQrm.nYrpxEzesnIdbLxyx4M0lrxHlTMNQJ3ks4HDLhPJ.Ag-- Received: from [64.236.128.27] by web60525.mail.yahoo.com via HTTP; Wed, 13 Dec 2006 03:47:18 PST Date: Wed, 13 Dec 2006 03:47:18 -0800 (PST) From: Ravi Periasamy Subject: Re: issues with Statement.getTimestamp(int, Calendar) To: Dave Cramer Cc: Oliver Jowett , pgsql-jdbc@postgresql.org, Ravi Periasamy In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <752250.99365.qm@web60525.mail.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.718 tagged_above=0 required=5 tests=AWL, BAYES_00, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: X-Archive-Number: 200612/62 X-Sequence-Number: 16294 Dave, I'm in Asia/Calcutta (India) time zone. It is +5.30 from GMT. I'm almost certain there's a bug in Statement.getTimestamp(int, Calendar). Where as, Resultset.getTimestamp(int, Calendar) gives the correct value. I suspect the AbstractJdbc2Statement.changetime() method. Thanks Ravi --- Dave Cramer wrote: > Ravi, > > what is your time zone from what you have my guess > would be -9:00 ? > > I think the JVM adjusts the actual time to your > local timezone when > it prints it. > > Dave > On 12-Dec-06, at 11:05 PM, Ravi Periasamy wrote: > > > The test case is as follows. > > > > I created a function as follows: > > ================================================== > > create or replace function testouttimestamp(OUT a1 > > timestamp) AS $$ > > begin > > a1 := '1970-01-01 00:00:00'; > > end; > > $$ language plpgsql; > > ================================================== > > > > and called through JDBC as follows: > > ================================================== > > TimeZone tz = TimeZone.getTimeZone("GMT"); > > Calendar cr = Calendar.getInstance(tz); > > CallableStatement stmt = con.prepareCall( "{call > > testouttimestamp(?)}"); > > stmt.registerOutParameter(1, Types.TIMESTAMP); > > stmt.execute(); > > Timestamp ts = stmt.getTimestamp(1, cr); > > System.out.println("ts = " + ts); > > ================================================== > > > > Actual Result ==> > > 1969-12-31 18:30:00.0 > > > > Expected Result ==> > > 1970-01-01 05:30:00.0 > > > > Note: ResultSet.getTimestamp(int, Calendar) works > > fine. > > > > Thanks > > Ravi > > > > --- Oliver Jowett wrote: > > > >> Ravi Periasamy wrote: > >>> Dear PSQL-JDBC team, > >>> > >>> There is a issue with > Statement.getTimestamp(int, > >>> Calendar). The timestamp is offset in the wrong > >>> direction. > >>> > >>> The quivalent on ResultSet.getTimestamp(int, > >> Calendar) > >>> works fine. > >>> > >>> Is this a known bug, can we expect a fix for > this, > >>> when? > >> > >> Can you send a testcase demonstrating the problem > >> please? > >> > >> -O > >> > > > > > > > > > > > ______________________________________________________________________ > > > ______________ > > Want to start your own business? > > Learn how on Yahoo! Small Business. > > http://smallbusiness.yahoo.com/r-index > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 4: Have you searched our list archives? > > > > http://archives.postgresql.org > > > > ____________________________________________________________________________________ Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail beta. http://new.mail.yahoo.com