Message-ID: From: "m-van-tilburg (@m-van-tilburg)" To: "pgjdbc/pgjdbc" Date: Thu, 02 Oct 2025 14:12:14 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3837: ResultSet.getTimestamp() returns incorrect point in time for historical dates In-Reply-To: References: List-Id: X-GitHub-Author-Login: m-van-tilburg X-GitHub-Comment-Id: 3361406249 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3837 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3837#issuecomment-3361406249 Content-Type: text/plain; charset=utf-8 > Interesting problem. How would you propose we solve how to figure out what calendar to use? According to https://www.postgresql.org/docs/17/datetime-units-history.html all dates are treated as (proleptic) Gregorian. The JDBC API also suggests that provided `Calendar` objects are used to only get time zone information from. Code like `private final Calendar calendarWithUserTz = new GregorianCalendar();` in `org.postgresql.jdbc.TimestampUtils` appears to have been written in the assumption that this creates a pure (proleptic) Gregorian calendar. However, using `new GregorianCalendar()` actually creates a calendar that is a hybrid of the Julian and the Gregorian calendar using the default change date of October 15, 1582 (Gregorian). Read `java.util.GregorianCalendar#setGregorianChange(java.util.Date)` for more information.