From: Roland Roberts <roland@astrofoto.org>
To: pgsql-jdbc@postgresql.org
Subject: Re: ResultSet.getTimestamp(Calendar) off by one-hour
Date: Fri, 13 Mar 2009 16:31:40 -0400
Message-ID: <49BAC2AC.1010505@astrofoto.org> (raw)
In-Reply-To: <4747.1236975395@sss.pgh.pa.us>
References: <49BA8D93.4010901@astrofoto.org>
<49BAAE48.8050705@astrofoto.org>
<4747.1236975395@sss.pgh.pa.us>
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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: roland@astrofoto.org
Subject: Re: ResultSet.getTimestamp(Calendar) off by one-hour
In-Reply-To: <49BAC2AC.1010505@astrofoto.org>
References: <49BA8D93.4010901@astrofoto.org> <49BAAE48.8050705@astrofoto.org> <4747.1236975395@sss.pgh.pa.us> <49BAC2AC.1010505@astrofoto.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox