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 D3EB2D1C948 for ; Tue, 22 Jul 2003 05:39:34 +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 10451-08 for ; Tue, 22 Jul 2003 05:39:33 +0000 (GMT) Received: from mail.xythos.com (unknown [206.14.210.116]) by svr1.postgresql.org (Postfix) with ESMTP id 1B502D1C947 for ; Tue, 22 Jul 2003 02:39:33 -0300 (ADT) Received: from ravms by mail.xythos.com with mail-ok (Exim 3.36 #3) id 19eps2-0002vs-00; Tue, 22 Jul 2003 05:39:30 +0000 Received: from h-66-166-17-184.snvacaid.covad.net ([66.166.17.184] helo=xythos.com) by mail.xythos.com with asmtp (Exim 3.36 #3) id 19eps2-0002vg-00; Tue, 22 Jul 2003 05:39:30 +0000 Message-ID: <3F1CCDF3.3040006@xythos.com> Date: Mon, 21 Jul 2003 22:38:59 -0700 From: Barry Lind User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kim Ho Cc: pgsql-jdbc-list , Fernando Nasser , Dave Cramer Subject: Re: Fix for using JDK1.2 instead of JDK1.4 method in date/time/timestampToString References: <1058452161.20165.12.camel@topanga.toronto.redhat.com> In-Reply-To: <1058452161.20165.12.camel@topanga.toronto.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Envelope-To: kho@redhat.com, pgsql-jdbc@postgresql.org, fnasser@redhat.com, Dave@micro-automation.net X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/272 X-Sequence-Number: 7656 Patch applied. --Barry Kim Ho wrote: > Uses a slightly longer method of getting the rawoffset and then adding > the DST offset if any. > > Cheers, > > Kim > > > > > ------------------------------------------------------------------------ > > ? temp.diff > Index: Makefile > =================================================================== > 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 $ > # > #------------------------------------------------------------------------- > > --- 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 $ > # > #------------------------------------------------------------------------- > > Index: org/postgresql/jdbc1/AbstractJdbc1Statement.java > =================================================================== > 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 -0000 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 == s.length()) > { > timezone = Integer.parseInt(s.substring(timezoneLocation+1,s.length())); > ! localoffset = java.util.Calendar.getInstance().getTimeZone().getOffset(millis); > if (s.charAt(timezoneLocation)=='+') > timezone*=-1; > } > --- 2072,2081 ---- > if (timezoneLocation>7 && timezoneLocation+3 == s.length()) > { > timezone = Integer.parseInt(s.substring(timezoneLocation+1,s.length())); > ! // localoffset = java.util.Calendar.getInstance().getTimeZone().getOffset(millis); > ! localoffset = java.util.Calendar.getInstance().getTimeZone().getRawOffset(); > ! if (java.util.Calendar.getInstance().getTimeZone().inDaylightTime(new java.sql.Date(millis))) > ! localoffset += 60*60*1000; > if (s.charAt(timezoneLocation)=='+') > timezone*=-1; > } > *************** public abstract class AbstractJdbc1State > *** 2101,2107 **** > if (timezoneLocation != -1 && timezoneLocation+3 == s.length()) > { > timezone = Integer.parseInt(s.substring(timezoneLocation+1,s.length())); > ! localoffset = java.util.Calendar.getInstance().getTimeZone().getOffset(millis); > if (s.charAt(timezoneLocation)=='+') > timezone*=-1; > } > --- 2104,2113 ---- > if (timezoneLocation != -1 && timezoneLocation+3 == s.length()) > { > timezone = Integer.parseInt(s.substring(timezoneLocation+1,s.length())); > ! // localoffset = java.util.Calendar.getInstance().getTimeZone().getOffset(millis); > ! localoffset = java.util.Calendar.getInstance().getTimeZone().getRawOffset(); > ! if (java.util.Calendar.getInstance().getTimeZone().inDaylightTime(new java.sql.Time(millis))) > ! localoffset += 60*60*1000; > if (s.charAt(timezoneLocation)=='+') > timezone*=-1; > } > *************** public abstract class AbstractJdbc1State > *** 2146,2152 **** > if (timezoneLocation>8 && timezoneLocation+3 == s.length()) > { > timezone = Integer.parseInt(s.substring(timezoneLocation+1,s.length())); > ! localoffset = java.util.Calendar.getInstance().getTimeZone().getOffset(millis); > if (s.charAt(timezoneLocation)=='+') > timezone*=-1; > } > --- 2152,2161 ---- > if (timezoneLocation>8 && timezoneLocation+3 == s.length()) > { > timezone = Integer.parseInt(s.substring(timezoneLocation+1,s.length())); > ! // localoffset = java.util.Calendar.getInstance().getTimeZone().getOffset(millis); > ! localoffset = java.util.Calendar.getInstance().getTimeZone().getRawOffset(); > ! if (java.util.Calendar.getInstance().getTimeZone().inDaylightTime(new java.sql.Timestamp(millis))) > ! localoffset += 60*60*1000; > if (s.charAt(timezoneLocation)=='+') > timezone*=-1; > } > > > ------------------------------------------------------------------------ > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org