fix: make all Calendar instances proleptic Gregorian (#3837)#3887
Merged
davecramer merged 2 commits intopgjdbc:masterfrom Dec 16, 2025
Merged
fix: make all Calendar instances proleptic Gregorian (#3837)#3887davecramer merged 2 commits intopgjdbc:masterfrom
davecramer merged 2 commits intopgjdbc:masterfrom
Conversation
Calendar instances created with Calendar.getInstance() or new GregorianCalendar() are by default a hybrid of the Julian and the Gregorian calendar. Java classes like java.sql.Date and SimpleDateFormat also (sometimes) use Calendar instances and therefore might also be affected. This differs from the java.time classes that use the proleptic Gregorian calendar by default. The postgresql server also uses the proleptic Gregorian calendar and therefore it makes sense to make all Calendar instances in the pgjdbc code proleptic Gregorian too.
m-van-tilburg
commented
Dec 4, 2025
m-van-tilburg
commented
Dec 4, 2025
Make TimestampUtils.createProlepticGregorianCalendar(TimeZone) public and use it in all other places too.
Contributor
Author
|
@davecramer do you have any review comments that I should address? |
olavloite
added a commit
to GoogleCloudPlatform/pgadapter
that referenced
this pull request
Jan 30, 2026
Change needed due to pgjdbc/pgjdbc#3887
olavloite
added a commit
to GoogleCloudPlatform/pgadapter
that referenced
this pull request
Jan 30, 2026
Change needed due to pgjdbc/pgjdbc#3887
olavloite
added a commit
to GoogleCloudPlatform/pgadapter
that referenced
this pull request
Jan 30, 2026
) * build(deps): bump org.postgresql:postgresql from 42.7.8 to 42.7.9 Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.8 to 42.7.9. - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](pgjdbc/pgjdbc@REL42.7.8...REL42.7.9) --- updated-dependencies: - dependency-name: org.postgresql:postgresql dependency-version: 42.7.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * chore: relax test for pre-Gregorian dates Change needed due to pgjdbc/pgjdbc#3887 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Knut Olav Løite <[email protected]>
davecramer
added a commit
that referenced
this pull request
Feb 6, 2026
davecramer
added a commit
that referenced
this pull request
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calendar instances created with Calendar.getInstance() or new GregorianCalendar() are by default a hybrid of the Julian and the Gregorian calendar. Java classes like java.sql.Date and SimpleDateFormat also (sometimes) use Calendar instances and therefore might also be affected. This differs from the java.time classes that use the proleptic Gregorian calendar by default. The postgresql server also uses the proleptic Gregorian calendar and therefore it makes sense to make all Calendar instances in the pgjdbc code proleptic Gregorian too. This will fix #3837