From 8cbdc01c284f504cdd2152acf376982501c42c6f Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Tue, 22 May 2001 14:46:46 +0000 Subject: [PATCH] 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... --- src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index 561614b33a..4b988a3e4f 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"); -- 2.39.5