Skip to content

Commit

Permalink
Tiny bug in integration test: it didn't like the -0700 timezone.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldcasillas-progreso committed Apr 18, 2014
1 parent f39aceb commit 6eaa9a3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,10 @@ public void execute(Statement statement) throws SQLException {
// fixing connection timezone to the "client's one"
TimeZone currentTimeZone = TimeZone.getDefault();
int offset = currentTimeZone.getRawOffset() + currentTimeZone.getDSTSavings();
String timeZoneAsAString = String.format("%s%02d:%02d", offset >= 0 ? "+" : "-", offset / 3600000,
(offset / 60000) % 60);
String timeZoneAsAString = String.format("%s%02d:%02d",
offset >= 0 ? "+" : "-",
Math.abs(offset / 3600000),
(offset / 60000) % 60);
statement.execute("SET time_zone = '" + timeZoneAsAString + "'");
}
});
Expand Down

0 comments on commit 6eaa9a3

Please sign in to comment.