Skip to content

Commit 5f5f8b9

Browse files
committed
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
1 parent 3142078 commit 5f5f8b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
369369
SimpleDateFormat df = (SimpleDateFormat) tl_tsdf.get();
370370
if(df==null) {
371371
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
372+
df.setTimeZone(TimeZone.getTimeZone("GMT"));
372373
tl_tsdf.set(df);
373374
}
374-
df.setTimeZone(TimeZone.getTimeZone("GMT"));
375375

376376
// Use the shared StringBuffer
377377
synchronized(sbuf) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy