Received: from maia.hub.org (maia-4.hub.org [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A913A63224D for ; Tue, 18 May 2010 19:02:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 32455-08 for ; Tue, 18 May 2010 22:01:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 9940762F449 for ; Tue, 18 May 2010 19:01:53 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OEUr6-0007Sq-9x for pgsql-jdbc@postgresql.org; Wed, 19 May 2010 00:01:40 +0200 Received: from ppp-93-104-180-197.dynamic.mnet-online.de ([93.104.180.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 May 2010 00:01:40 +0200 Received: from spam_eater by ppp-93-104-180-197.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 May 2010 00:01:40 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org connect(): No such file or directory From: Thomas Kellerer Subject: Re: JDBC Driver and timezones Date: Wed, 19 May 2010 00:01:29 +0200 Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: ppp-93-104-180-197.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/48 X-Sequence-Number: 20532 Carsten Klein wrote on 18.05.2010 23:35: > actually, your application server is not using the system's default > timezone, see the configuration of your server. The timezone is correct. The DST information seems to be "broken". Besides: I'm not using an application server. It's a Swing application that retrieves the data via JDBC The output from my initial post was from a very simply main() class, only runs that single statement I posted in my initial post. Even then it only works when I manually set user.timezone=GMT+2 And for the test case the client application _and_ Postgres were running on the same physical machine. So the JVM (and thus the JDBC driver) and Postgres should use the same timezone information from my Windows. When I output the value of user.timezone (when not setting it manually) it does report the correct one: Europe/Berlin, but for some reason it does not apply the DST settings correctly. > In order to overcome this problem, I have adjusted a db layer that we are > using in the OSS VerA.Web project so that it will use proxies for the most > relevant objects (resultset and so on) that then will just drop the > timezone information in the data received from the database, so that when > instantiating the datetime object in the application server, it will > automatically take over the configured timezone. That way, you will > experience no timeshift, whatsoever. > > See > https://evolvis.org/scm/viewvc.php/tags/tarent-database-1.5.4verawebpl3/src/main/java/de/tarent/dblayer/engine/proxy/?root=tarentdatabase Thanks for the link, but as I said: this is a Swing application that directly connects to the Postgres server. But I'm curious: why didn't you simply change the timezone for the JVM running your appserver? Regards Thomas