Received: from alpha.math.uiuc.edu (alpha.math.uiuc.edu [128.174.110.100]) by hub.org (8.9.1/8.9.1) with ESMTP id UAA05892 for ; Sun, 3 Jan 1999 20:17:47 -0500 (EST) (envelope-from rohwer@uiuc.edu) Received: from rigel.math.uiuc.edu (rigel.math.uiuc.edu [128.174.111.32]) by alpha.math.uiuc.edu (8.8.5/8.8.5) with ESMTP id TAA00904 for ; Sun, 3 Jan 1999 19:17:43 -0600 (CST) Received: from uiuc.edu (localhost [127.0.0.1]) by rigel.math.uiuc.edu (8.9.0/8.9.0) with ESMTP id TAA20778 for ; Sun, 3 Jan 1999 19:17:43 -0600 (CST) Sender: rohwer@math.uiuc.edu Message-ID: <369016B6.E9B16861@uiuc.edu> Date: Sun, 03 Jan 1999 19:17:42 -0600 From: Thomas Rohwer Organization: Math Department, University of Illinois at Urbana-Champaign X-Mailer: Mozilla 4.03 [en] (X11; I; SunOS 5.5.1 sun4m) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: jdbc timestamp-parsing Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit There is a little typo in the code for getTimestamp in the file jdbc1/ResultSet.java and jdbc2/ResultSet.java public Timestamp getTimestamp(int columnIndex) throws SQLException { String s = getString(columnIndex); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzz"); 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; // should probably be s.substring(0,19)+ nm which leads to an incorrect interpretation of timestamps: timestamp:1999-01-03 18:35:47+01 date:1999-01-03 18:35:04.0 . Thomas Rohwer