pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: AFulgens (@AFulgens) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3930: Revert semantic calendar changes introduced with #3837
Date: Fri, 06 Feb 2026 10:21:46 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Example the other way around:

Java code:
```
String select = "SELECT * FROM public.testtable";
statement = connection.prepareStatement(select);
resultSet = statement.executeQuery();

while (resultSet.next()) {
    String str = resultSet.getString(2);
    java.sql.Date date = resultSet.getDate(2);
    System.out.println("As String: " + str);
    System.out.println("As sql.Date: " + date);
    System.out.println("Epoch within sql.Date: " + date.getTime());
}
```

**psql execution:**
```
postgres=# insert into public.testtable(this_is_a_date) values ('1000-01-01');
INSERT 0 1
postgres=# select * from public.testtable;
 id | this_is_a_date
----+----------------
 50 | 1000-01-01
(1 row)
```

**Result with driver 42.7.8:**
```
As String: 1000-01-01
As sql.Date: 1000-01-01
Epoch within sql.Date: -30609795600000
```

**Result with driver 42.7.9:**
```
As String: 1000-01-01
As sql.Date: 0999-12-27
Epoch within sql.Date: -30610227600000
```

view thread (24+ 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 #3930: Revert semantic calendar changes introduced with #3837
  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