From: Bruce Momjian Date: Wed, 4 Jul 2001 15:08:32 +0000 (+0000) Subject: This patch moves the setting of the timezone on the SimpleDateFormat X-Git-Url: http://git.postgresql.org/gitweb/-?a=commitdiff_plain;h=5f5f8b97e2242255de436a2247b7face91a23c77;p=users%2Frhaas%2Fpostgres.git This patch moves the setting of the timezone on the SimpleDateFormat object inside the initialization section instead of doing it everytime the setTimestamp method is called. Thanks to Dave Harkness for this suggestion. Barry Lind --- diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java b/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java index 69898cc3c9..1936845a92 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java @@ -369,9 +369,9 @@ public class PreparedStatement extends Statement implements java.sql.PreparedSta SimpleDateFormat df = (SimpleDateFormat) tl_tsdf.get(); if(df==null) { df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + df.setTimeZone(TimeZone.getTimeZone("GMT")); tl_tsdf.set(df); } - df.setTimeZone(TimeZone.getTimeZone("GMT")); // Use the shared StringBuffer synchronized(sbuf) {