From: Thomas G. Lockhart Date: Tue, 22 May 2001 14:46:46 +0000 (+0000) Subject: Patch from Barry Lind to correctly decode time zones in timestamp results. X-Git-Tag: REL7_1_2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b471cc338777b84f3510b124aeaa7de75572848;p=thirdparty%2Fpostgresql.git Patch from Barry Lind to correctly decode time zones in timestamp results. Without patch, the time zone field is ignored and the returned time is not correct. Already applied to the development tree... --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index 561614b33ab..4b988a3e4fa 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java @@ -499,13 +499,13 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu // could optimize this a tad to remove too many object creations... SimpleDateFormat df = null; - if (s.length()>23 && subsecond) { + if (sbuf.length()>23 && subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSzzzzzzzzz"); - } else if (s.length()>23 && !subsecond) { + } else if (sbuf.length()>23 && !subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:sszzzzzzzzz"); - } else if (s.length()>10 && subsecond) { + } else if (sbuf.length()>10 && subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - } else if (s.length()>10 && !subsecond) { + } else if (sbuf.length()>10 && !subsecond) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } else { df = new SimpleDateFormat("yyyy-MM-dd");