pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: m-van-tilburg (@m-van-tilburg) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3837: ResultSet.getTimestamp() returns incorrect point in time for historical dates
Date: Thu, 02 Oct 2025 14:12:14 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

> 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.

view thread (13+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] issue #3837: ResultSet.getTimestamp() returns incorrect point in time for historical dates
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox