Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQlxm-0003rf-N2 for pgsql-jdbc@arkaria.postgresql.org; Tue, 21 Apr 2020 06:00:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQlxl-00060h-H5 for pgsql-jdbc@arkaria.postgresql.org; Tue, 21 Apr 2020 06:00:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQlxl-00060a-8g for pgsql-jdbc@lists.postgresql.org; Tue, 21 Apr 2020 06:00:53 +0000 Received: from mout.gmx.net ([212.227.15.18]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQlxi-000793-BP for pgsql-jdbc@lists.postgresql.org; Tue, 21 Apr 2020 06:00:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1587448848; bh=MdUeBTofKglVghUM0Y4vF6xjQESN152k8c6z86uftWo=; h=X-UI-Sender-Class:To:From:Subject:Date; b=lPm78HI9lMTOwv0GaR/aytimnCNW9/bQGJIhP1CTO2ZCvXtLCCGVFO1Ytwjh+uKeO c4b8ptw2PFpTdda/qBf+FG2Ah0FV+V4FADoYlcVSZQ63vOzF/ljGLSDvVBVlpUD7VA InLTLECzSdStHWkEpPGt0bgXEadc1QOyqMBc9CkQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.25] ([188.174.172.232]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mxm3Q-1j0rYH47eo-00zDh5 for ; Tue, 21 Apr 2020 08:00:48 +0200 To: pgsql-jdbc@lists.postgresql.org From: Thomas Kellerer Subject: JDBC and timetz again Message-ID: Date: Tue, 21 Apr 2020 08:00:48 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:zN3uFJb20g7b6RJUGgH8ZFOrOoR2muTAu9B5cP9/3DOwBhg5l+e q80Ttuj2b7rvpb5yleBS2Ot+4UBn5KnV4j6lo/RqZLZjZw26pFjJWebyjTjdPbyzCe3iZ2N khkrSpe4XYva4jAW9T8Jwt3b/eRu3OyLlztfOZQawBwX0PZhDghXR3p1r7r2EoG0NdBUW44 8knphW8Ii6hPqiuwHbfdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:tZC/0x8LNsk=:sE6c6x+wGMgkUnE9Gfzd95 1RsEhZ6Qj3KsEzqP/FyWkfLI/7yNKRy8U7Icm//r59mGzj8OWCzde2X/hWrKt4FJQvWj9iZB8 s/W0kAyJmcE/pD24IB0qxsPYc8gV/4rsBZSt2xTH+ntDKyVd4geVLOxgpE4//qGyL+tMoSXdJ HeNOHdtrRdFNhmvMwHLG6XvcaLpLJVbrM0yeYjzgqNL0rZNRdR8P0JlLmblaECy1erKy9i/pV XwzvaQZNpen/ROmH6WejlJj8649TXRdk+WzzBSw6K6Sy6mq29KROlQzSsoz0Hq3Pd7FZF/wlF eFVnMLCQOK6KQtTvHHdN2Wp/kmufjk8E9oq6QFyq4uaSuUzsRXnZdmDJCJpNBAJ0tIn+eC4Y5 sVwU1AdRaNKVJg3SPjBQoiJUFI9XECrHeRLCKh3a8LrzBNwekBQKdAMdgW9TqhotLd+m16gKI T22JRkV+Y/mCYGBvrwUplx4MQjkBMaxibf34QlFD+ZF4Ak/GY4F3BoKfjjcjwCgtEmKGaFHxK 6G8X+BFPRS86YXYPO+lOZ6ofqePRQVUzWudWWxtwVDVm2iG2eGtNkmQDG69feCobasvXUmoIe NQ8irxyLBvRO9OHga1i/X73KN+apVL3QOlFYdA3v7soxRXsE6s2PTx1tC248TgnpzUpS32L8Z 1jI+Y2oanTkTRwWKo+kPApmEq+klXR0gM4Du01EY+lG+hhU3QmTin3sYfMFJKys+uakKAcdhA G605rcufk9ynzP2oTlpYGy0OJapizQqOqFa72OAsMny0h6Rp3sAGcOhiJAD+eeZ2KuA91SlX9 bos1DwadBwL52EbEhGVJpaY7hvaWKbyKtPuXdP1mL8hxGc+njAzS4F2nqdWGwcS323cmhp5ip MvORQwsBvP463HJ6wykTEWW+hDIotOXzb67HLZAf//FKEtLf4a5cbJa4Eyc26EjpuODhrctyJ zXuNpTNuBIaOb6EPsQ+z/GUR6iZ0pc447XARq+Z3YFDkTj+IxaWkQsKIDuSn1L6Vv1Y4HU5l9 sShlVcof1c389TRl+use3qq9QDc+ixZF0jRPTlh066ihaE2DkJMg9v5RnNkGVvsUzFHXDzTCe HYLIUSMY2omcSyHhHxK4/IAcnm97hN2sEpbXK2+hH0Y87XgVPKHoleGvPFnfoV255foO/JA2n xSHVfyOD39SkPbdb7gaUJT6/qbK2y0mjjykFOwX5XJ9Ktp3v06t79SUbnv5z4JLqW96E0KUzQ 1wkq+OlaQ5J79H7PH List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, last year I asked[1] about not being able go use ResultSet.getObject(..., = LocalTime.class) for columns defined as timetz. This typically happens when using "current_time" in a SELECT statement. So I decided to switch to ResultSet.getTime() for those columns. However, = it turns out this doesn't work properly when DST is in effect. Postgres runs locally on my laptop and my Windows is set to Europe/Berlin = and to automatically adjust DST. But when I run "SELECT current_time" at 10:00 ResultSet.getTime() returns = 09:00. I had a brief look at the source code, and it seems that the driver does t= ry to adjust the time to the current TimeZone (as returned from Calendar).= But still returning a time that is an hour off seems like a bug to me. I managed to work around that, by adding the TimeZone.getRawOffset() to th= e time retrieved from the driver. But that seems wrong. Any ideas? Regards Thomas [1] https://www.postgresql.org/message-id/flat/q89m8j%2463i8%241%40blaine.= gmane.org