Message-ID: From: "m-van-tilburg (@m-van-tilburg)" To: "pgjdbc/pgjdbc" Date: Mon, 09 Feb 2026 15:43:31 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3930: Revert semantic calendar changes introduced with #3837 In-Reply-To: References: List-Id: X-GitHub-Author-Login: m-van-tilburg X-GitHub-Comment-Id: 3872512501 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2026-02-09T16:20:33Z X-GitHub-Issue: 3930 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3930#issuecomment-3872512501 Content-Type: text/plain; charset=utf-8 > This ship has sailed when `java.sql.Date` and `java.sql.Timestamp` has been bound into JDBC and packed with too much magic (throwing no shade on the original authors, time is extremely difficult, and even the new Java time API is not perfect, I sincerely think that it's an unsolvable problem). The "proper" scenario would be a new JDBC API which uses `java.time.OffsetDateTime` as default, but that will never happen. > > I think there is no proper solution here on the JDBC-driver level. Clients, who care about semantical correctness, must correct the data _after_ querying it from the `ResultSet`. > > Note that if the decision is made for a backroll, it would be nice to notify the MSSQL JDBC team, they currently have an open issue for introducing the same change [microsoft/mssql-jdbc#2789](https://github.com/microsoft/mssql-jdbc/issues/2789) but it's not merged yet. I am not sure if you are aware but support for `java.time` classes (using `preparedStatement.setObject()` and `resultSet.getObject()`) was added in [JDBC 4.2](https://download.oracle.com/otndocs/jcp/jdbc-4_2-mrel2-spec/index.html) (Java 8) As a side note, I tested the legacy date/time classes behavior with three JDBC drivers, "pgjdbc", "mssql-jdbc" and "ojdbc" (Oracle). The Oracle JDBC driver does use the proleptic Gregorian calendar in all cases. For our software (that supports all three databases mentioned above) we configured Hibernate to always use the `java.time` classes for JDBC. This makes things simple because everything is always proleptic Gregorian and the legacy date/time classes can be circumvented all together.