Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1499 rounding for timestamps truncated to dates before 1970 #1502

Merged
merged 4 commits into from Jun 17, 2019

Conversation

Projects
None yet
4 participants
@davecramer
Copy link
Member

commented Jun 14, 2019

See subject

@davecramer davecramer referenced this pull request Jun 14, 2019

Closed

Timestamp to Date Rounding Error #1499

1 of 2 tasks complete
@AppVeyorBot

This comment has been minimized.

Copy link

commented Jun 14, 2019

@AppVeyorBot

This comment has been minimized.

Copy link

commented Jun 14, 2019

@bokken

This comment has been minimized.

Is this comparing a java.util.Date to a java.sql.Date?
Should the millisecond value be compared instead?

This comment has been minimized.

Copy link
Owner Author

replied Jun 15, 2019

Yes, @vlsi already mentioned that. I will redo the PR using Math.floorDiv and fix this as well. Thanks!

@AppVeyorBot

This comment has been minimized.

Copy link

commented Jun 16, 2019

@AppVeyorBot

This comment has been minimized.

Copy link

commented Jun 17, 2019

@davecramer davecramer merged commit c9a7078 into pgjdbc:master Jun 17, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@@ -1232,7 +1232,12 @@ public Date convertToDate(long millis, TimeZone tz) {
if (tz == null) {
tz = getDefaultTz();
}
if (isSimpleTimeZone(tz.getID())) {
/*
the following math does not work for negative times

This comment has been minimized.

Copy link
@vlsi

vlsi Jun 18, 2019

Member

It looks like floorDiv supercedes this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.