Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ec8ee0

Browse files
author
Barry Lind
committed
Fix to properly handle timezone offsets that are partial hours. If the offset
was a partial hour and less than gmt (i.e. -02:30) the code would corrupt theminutes part. Modified Files: jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
1 parent618d56d commit2ec8ee0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
importjava.sql.Types;
2727
importjava.util.Vector;
2828

29-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.38 2003/09/18 04:14:27 barry Exp $
29+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Statement.java,v 1.39 2003/09/23 06:13:52 barry Exp $
3030
* This class defines methods of the jdbc1 specification. This class is
3131
* extended by org.postgresql.jdbc2.AbstractJdbc2Statement which adds the jdbc2
3232
* methods. The real Statement class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Statement
@@ -1245,14 +1245,21 @@ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
12451245
}
12461246
else
12471247
{
1248-
sbuf.append(-l_houros);
1248+
sbuf.append(-l_houros);
12491249
}
12501250
intl_minos =l_offset - (l_houros *60);
12511251
if (l_minos !=0)
12521252
{
1253-
if (l_minos <10)
1253+
if (l_minos> -10 &&l_minos<10)
12541254
sbuf.append('0');
1255-
sbuf.append(l_minos);
1255+
if (l_minos >=0)
1256+
{
1257+
sbuf.append(l_minos);
1258+
}
1259+
else
1260+
{
1261+
sbuf.append(-l_minos);
1262+
}
12561263
}
12571264
sbuf.append("'");
12581265
bind(parameterIndex,sbuf.toString(),PG_TIMESTAMPTZ);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp