]> granicus.if.org Git - postgresql/commitdiff
This patch moves the setting of the timezone on the SimpleDateFormat
authorBruce Momjian <bruce@momjian.us>
Wed, 4 Jul 2001 15:08:32 +0000 (15:08 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 4 Jul 2001 15:08:32 +0000 (15:08 +0000)
object inside the initialization section instead of doing it everytime
the setTimestamp method is called.  Thanks to Dave Harkness for this
suggestion.

Barry Lind

src/interfaces/jdbc/org/postgresql/jdbc2/PreparedStatement.java

index 69898cc3c9339409cd99baa02be3c051e01e4c11..1936845a92b6bef7a946ef9c10472e361133455b 100644 (file)
@@ -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) {