Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3EF0A6337D7 for ; Fri, 13 Mar 2009 17:31:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 81333-03 for ; Fri, 13 Mar 2009 17:31:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx.astrofoto.org (mx.astrofoto.org [216.254.78.156]) by mail.postgresql.org (Postfix) with ESMTP id 95E2A6330E2 for ; Fri, 13 Mar 2009 17:31:47 -0300 (ADT) Message-ID: <49BAC2AC.1010505@astrofoto.org> Date: Fri, 13 Mar 2009 16:31:40 -0400 From: Roland Roberts User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org References: <49BA8D93.4010901@astrofoto.org> <49BAAE48.8050705@astrofoto.org> <4747.1236975395@sss.pgh.pa.us> In-Reply-To: <4747.1236975395@sss.pgh.pa.us> Subject: Re: ResultSet.getTimestamp(Calendar) off by one-hour Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.2 (built Tue, 02 May 2006 07:36:10 -0400) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/72 X-Sequence-Number: 19402 Tom Lane wrote: > Apparently you're using a timestamp WITHOUT time zone column to store > the data. Not recommended if you are worried about timezone effects, > since by definition the apparent value depends on caller's timezone > context. Use timestamp WITH time zone and see if it gets better. > Ultimately, I need something that will be (mostly) compatible across different databases. The application will be using Hibernate and switching datasources will be routine, especially as part of the testing process. To that end, I'm using a user defined type with Hibernate to intercept the database access and store and retrieve times in UTC regardless of the local JVM time. I can certainly try timestamp with time zone, but the plan is to deploy with a column that does not include time zone because all times are supposed to be stored in UTC. And clients WILL be connecting from other time zones. Based on the tests I just ran, it looks like the JVM doesn't understand the local time zone. Although my host sure seems to know that the zone is America/New_York, the JVM is telling me it is GMT-05:00. I'm not sure why, but it doesn't really look like a postgresql problem at this point. roland -- PGP Key ID: 66 BC 3B CD Roland B. Roberts, PhD RL Enterprises roland@rlenter.com 6818 Madeline Court roland@astrofoto.org Brooklyn, NY 11220