Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA00764; Tue, 6 Jul 1999 23:17:45 -0400 (EDT) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id XAA02066; Tue, 6 Jul 1999 23:17:15 -0400 (EDT) From: Bruce Momjian Message-Id: <199907070317.XAA02066@candle.pha.pa.us> Subject: Re: [PATCHES] Patch for JDBC timezone problems In-Reply-To: <37386522.B4491D51@compclass.com> from Andrew Merrill at "May 11, 1999 10:13:06 am" To: Andrew Merrill Date: Tue, 6 Jul 1999 23:17:15 -0400 (EDT) CC: pgsql-interfaces@hub.org, pgsql-patches@hub.org X-Mailer: ELM [version 2.4ME+ PL56 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit This was never applied. Can someone tell me if it should be. Peter? > The attached patch fixes the problems that the JDBC driver has with > timezones in getTimestamp. The issues were described in an earlier > post, this is just the patch. > > Andrew Merrill > > *** ./src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java.orig Tue May 11 09:39:37 1999 > --- ./src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java Tue May 11 09:40:56 1999 > *************** > *** 438,449 **** > > if (s != null) > { > int TZ = new Float(s.substring(19)).intValue(); > TZ = TZ * 60 * 60 * 1000; > TimeZone zone = TimeZone.getDefault(); > zone.setRawOffset(TZ); > String nm = zone.getID(); > ! s = s.substring(0,18) + nm; > try { > java.util.Date d = df.parse(s); > return new Timestamp(d.getTime()); > --- 438,451 ---- > > if (s != null) > { > + /* commented out by Andrew Merrill 5/1999 > int TZ = new Float(s.substring(19)).intValue(); > TZ = TZ * 60 * 60 * 1000; > TimeZone zone = TimeZone.getDefault(); > zone.setRawOffset(TZ); > String nm = zone.getID(); > ! s = s.substring(0,19) + nm; > ! */ > try { > java.util.Date d = df.parse(s); > return new Timestamp(d.getTime()); > *** ./src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java.orig Tue May 11 09:41:14 1999 > --- ./src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java Tue May 11 09:42:16 1999 > *************** > *** 440,451 **** > > if (s != null) > { > int TZ = new Float(s.substring(19)).intValue(); > TZ = TZ * 60 * 60 * 1000; > TimeZone zone = TimeZone.getDefault(); > zone.setRawOffset(TZ); > String nm = zone.getID(); > ! s = s.substring(0,18) + nm; > try { > java.util.Date d = df.parse(s); > return new Timestamp(d.getTime()); > --- 440,453 ---- > > if (s != null) > { > + /* commented out by Andrew Merrill 5/1999 > int TZ = new Float(s.substring(19)).intValue(); > TZ = TZ * 60 * 60 * 1000; > TimeZone zone = TimeZone.getDefault(); > zone.setRawOffset(TZ); > String nm = zone.getID(); > ! s = s.substring(0,19) + nm; > ! */ > try { > java.util.Date d = df.parse(s); > return new Timestamp(d.getTime()); -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026