pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kim Ho <kho@redhat.com>
To: pgsql-jdbc-list <pgsql-jdbc@postgresql.org>
Cc: Barry Lind <blind@xythos.com>
Cc: Fernando Nasser <fnasser@redhat.com>
Cc: Dave Cramer <Dave@micro-automation.net>
Subject: Fix for using JDK1.2 instead of JDK1.4 method in date/time/timestampToString
Date: 17 Jul 2003 10:29:21 -0400
Message-ID: <1058452161.20165.12.camel@topanga.toronto.redhat.com> (raw)

Uses a slightly longer method of getting the rawoffset and then adding
the DST offset if any.

Cheers,

Kim

Attachments:

fixsetobjectswithtimes.diff (text/plain, 4.0K) download ? 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; }

view thread (5+ messages)  latest in thread

Message-ID: <1058452161.20165.12.camel@topanga.toronto.redhat.com>
Permalink:  ../1058452161.20165.12.camel@topanga.toronto.redhat.com/
Also on:    postgresql.org/message-id/1058452161.20165.12.camel@topanga.toronto.redhat.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: kho@redhat.com, blind@xythos.com, fnasser@redhat.com, Dave@micro-automation.net
  Subject: Re: Fix for using JDK1.2 instead of JDK1.4 method in date/time/timestampToString
  In-Reply-To: <1058452161.20165.12.camel@topanga.toronto.redhat.com>
  References: <1058452161.20165.12.camel@topanga.toronto.redhat.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