pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Merrill <andrew@compclass.com>
To: pgsql-interfaces@hub.org
To: pgsql-patches@hub.org
Subject: Patch for JDBC timezone problems
Date: Tue, 11 May 1999 10:13:06 -0700
Message-ID: <37386522.B4491D51@compclass.com> (raw)

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

Attachments:

patch.jdbc (text/plain, 1.8K) download *** ./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());

view thread (3+ messages)  latest in thread

Message-ID: <37386522.B4491D51@compclass.com>
Permalink:  ../37386522.B4491D51@compclass.com/
Also on:    postgresql.org/message-id/37386522.B4491D51@compclass.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: andrew@compclass.com, pgsql-interfaces@hub.org, pgsql-patches@hub.org
  Subject: Re: Patch for JDBC timezone problems
  In-Reply-To: <37386522.B4491D51@compclass.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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