Message-ID: From: "AFulgens (@AFulgens)" To: "pgjdbc/pgjdbc" Date: Fri, 06 Feb 2026 09:41:59 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #3930: Revert semantic calendar changes introduced with #3837 In-Reply-To: References: List-Id: X-GitHub-Author-Login: AFulgens X-GitHub-Comment-Id: 3859151521 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3930 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3930#issuecomment-3859151521 Content-Type: text/plain; charset=utf-8 Simple example for clarity: Java code: ``` String insert; insert = "insert into public.testtable(this_is_a_date) values (?)"; statement = connection.prepareStatement(insert); statement.setDate(1, java.sql.Date.valueOf("1000-01-01")); statement.executeUpdate(); insert = "insert into public.testtable(this_is_a_date) values ('1000-01-01')"; statement = connection.prepareStatement(insert); statement.executeUpdate(); 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()); } ``` **Results with driver 42.7.8:** Output: ``` As String: 1000-01-01 As sql.Date: 1000-01-01 Epoch within sql.Date: -30609795600000 As String: 1000-01-01 As sql.Date: 1000-01-01 Epoch within sql.Date: -30609795600000 ``` psql: ``` postgres=# select * from public.testtable; id | this_is_a_date ----+---------------- 48 | 1000-01-01 49 | 1000-01-01 (2 rows) ``` **Result with driver 42.7.9:** Output: ``` As String: 1000-01-06 As sql.Date: 1000-01-01 Epoch within sql.Date: -30609795600000 As String: 1000-01-01 As sql.Date: 0999-12-27 Epoch within sql.Date: -30610227600000 ``` psql: ``` postgres=# select * from public.testtable; id | this_is_a_date ----+---------------- 42 | 1000-01-06 43 | 1000-01-01 (2 rows) ```