X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id D48D3CC8D7 for ; Thu, 17 Jul 2003 14:29:08 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 61890-04 for ; Thu, 17 Jul 2003 14:29:33 +0000 (GMT) Received: from touchme.toronto.redhat.com (to-telus.redhat.com [207.219.125.105]) by svr1.postgresql.org (Postfix) with ESMTP id 44854CAE14 for ; Thu, 17 Jul 2003 11:29:07 -0300 (ADT) Received: from topanga.toronto.redhat.com (topanga.toronto.redhat.com [172.16.14.11]) by touchme.toronto.redhat.com (Postfix) with ESMTP id DA79380031E; Thu, 17 Jul 2003 10:29:21 -0400 (EDT) Subject: Fix for using JDK1.2 instead of JDK1.4 method in date/time/timestampToString From: Kim Ho To: pgsql-jdbc-list Cc: Barry Lind , Fernando Nasser , Dave Cramer Content-Type: multipart/mixed; boundary="=-2ySIODurX4B+glIoWyI2" X-Mailer: Ximian Evolution 1.0.8 (1.0.8-11) Date: 17 Jul 2003 10:29:21 -0400 Message-Id: <1058452161.20165.12.camel@topanga.toronto.redhat.com> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/77 X-Sequence-Number: 7461 --=-2ySIODurX4B+glIoWyI2 Content-Type: text/plain Content-Transfer-Encoding: 7bit Uses a slightly longer method of getting the rawoffset and then adding the DST offset if any. Cheers, Kim --=-2ySIODurX4B+glIoWyI2 Content-Disposition: attachment; filename=fixsetobjectswithtimes.diff Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=fixsetobjectswithtimes.diff; charset=UTF-8 ? temp.diff Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/Makefile,v retrieving revision 1.38 diff -c -p -r1.38 Makefile *** Makefile 12 Feb 2003 06:13:04 -0000 1.38 --- Makefile 17 Jul 2003 14:23:09 -0000 *************** *** 4,10 **** # # Copyright (c) 2001, PostgreSQL Global Development Group # ! # $Header: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/Makefile,v = 1.38 2003/02/12 06:13:04 barry Exp $ # #------------------------------------------------------------------------- =20=20 --- 4,10 ---- # # Copyright (c) 2001, PostgreSQL Global Development Group # ! # $Header: /cvsroot/pgsql-server/src/interfaces/jdbc/Makefile,v 1.38 2003= /02/12 06:13:04 barry Exp $ # #------------------------------------------------------------------------- =20=20 Index: org/postgresql/jdbc1/AbstractJdbc1Statement.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql= /jdbc1/AbstractJdbc1Statement.java,v retrieving revision 1.27 diff -c -p -r1.27 AbstractJdbc1Statement.java *** org/postgresql/jdbc1/AbstractJdbc1Statement.java 9 Jul 2003 05:12:04 -0= 000 1.27 --- org/postgresql/jdbc1/AbstractJdbc1Statement.java 17 Jul 2003 14:23:11 -= 0000 *************** public abstract class AbstractJdbc1State *** 2072,2078 **** if (timezoneLocation>7 && timezoneLocation+3 =3D=3D s.length()) { timezone =3D Integer.parseInt(s.substring(timezoneLocation+1,s.length(= ))); ! localoffset =3D java.util.Calendar.getInstance().getTimeZone().getOffs= et(millis); if (s.charAt(timezoneLocation)=3D=3D'+') timezone*=3D-1; } --- 2072,2081 ---- if (timezoneLocation>7 && timezoneLocation+3 =3D=3D s.length()) { timezone =3D Integer.parseInt(s.substring(timezoneLocation+1,s.length(= ))); ! // localoffset =3D java.util.Calendar.getInstance().getTimeZone().getOf= fset(millis); ! localoffset =3D java.util.Calendar.getInstance().getTimeZone().getRawO= ffset(); ! if (java.util.Calendar.getInstance().getTimeZone().inDaylightTime(new = java.sql.Date(millis))) ! localoffset +=3D 60*60*1000; if (s.charAt(timezoneLocation)=3D=3D'+') timezone*=3D-1; } *************** public abstract class AbstractJdbc1State *** 2101,2107 **** if (timezoneLocation !=3D -1 && timezoneLocation+3 =3D=3D s.length()) { timezone =3D Integer.parseInt(s.substring(timezoneLocation+1,s.length(= ))); ! localoffset =3D java.util.Calendar.getInstance().getTimeZone().getOffs= et(millis); if (s.charAt(timezoneLocation)=3D=3D'+') timezone*=3D-1; } --- 2104,2113 ---- if (timezoneLocation !=3D -1 && timezoneLocation+3 =3D=3D s.length()) { timezone =3D Integer.parseInt(s.substring(timezoneLocation+1,s.length(= ))); ! // localoffset =3D java.util.Calendar.getInstance().getTimeZone().getOf= fset(millis); ! localoffset =3D java.util.Calendar.getInstance().getTimeZone().getRawO= ffset(); ! if (java.util.Calendar.getInstance().getTimeZone().inDaylightTime(new = java.sql.Time(millis))) ! localoffset +=3D 60*60*1000;=09=09=09 if (s.charAt(timezoneLocation)=3D=3D'+') timezone*=3D-1; } *************** public abstract class AbstractJdbc1State *** 2146,2152 **** if (timezoneLocation>8 && timezoneLocation+3 =3D=3D s.length()) { timezone =3D Integer.parseInt(s.substring(timezoneLocation+1,s.length(= ))); ! localoffset =3D java.util.Calendar.getInstance().getTimeZone().getOffs= et(millis); if (s.charAt(timezoneLocation)=3D=3D'+') timezone*=3D-1; } --- 2152,2161 ---- if (timezoneLocation>8 && timezoneLocation+3 =3D=3D s.length()) { timezone =3D Integer.parseInt(s.substring(timezoneLocation+1,s.length(= ))); ! // localoffset =3D java.util.Calendar.getInstance().getTimeZone().getOf= fset(millis); ! localoffset =3D java.util.Calendar.getInstance().getTimeZone().getRawO= ffset(); ! if (java.util.Calendar.getInstance().getTimeZone().inDaylightTime(new = java.sql.Timestamp(millis))) ! localoffset +=3D 60*60*1000; if (s.charAt(timezoneLocation)=3D=3D'+') timezone*=3D-1; } --=-2ySIODurX4B+glIoWyI2--