From 0b471cc338777b84f3510b124aeaa7de75572848 Mon Sep 17 00:00:00 2001
From: "Thomas G. Lockhart" <lockhart@fourpalms.org>
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 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");
-- 
GitLab