From: Jair da Silva Ferreira Jr <j2@amazon.com.br>
To: pgsql-jdbc@postgresql.org
Subject: Re: problem with dates when using a java calendar object with
Date: Thu, 14 Oct 2004 20:33:59 -0300
Message-ID: <416F0CE7.2000203@amazon.com.br> (raw)
In-Reply-To: <20041014100201.761efae5@kingfisher.intern.logi-track.com>
References: <416DB991.3060809@amazon.com.br>
<20041014100201.761efae5@kingfisher.intern.logi-track.com>
Hi Markus,
Markus Schaber wrote:
>Hi, Jair,
>
>On Wed, 13 Oct 2004 20:26:09 -0300
>Jair da Silva Ferreira Jr <j2@amazon.com.br> wrote:
>
>
>
>>Hi,
>> I am experiencing the following problem with postgresql: the date
>>value I insert into the database is different from the value I select
>>from the database. I use a Calendar with a non-default timezone to set
>>and get the date value (using methods
>>PreparedStatement.setDate(int,Date,Calendar) and
>>ResultSet.getDate(int,Calendar)).
>> Do you know how can I fix this problem? Am I doing anything wrong?
>>
>>
>
>Could you tell us how the table is defined? If you have it defined as
>"TIMESTAMP WITHOUT TIME ZONE", your dates always get converted to UTC
>and loose the time zone.
>
>
My test table definition is: create table date_test (d date)
As you can see it is a date type, so there's no time zone information on it.
Do you think that the date not having time zone information is the
source of the problem? If yes, what time zone should I use so that dates
are correctly inserted and selected? UTC time zone? The default JVM
timezone?
Thanks,
Jair Jr
>HTH,
>Markus
>
>
>
>
>
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: j2@amazon.com.br
Subject: Re: problem with dates when using a java calendar object with
In-Reply-To: <416F0CE7.2000203@amazon.com.br>
References: <416DB991.3060809@amazon.com.br> <20041014100201.761efae5@kingfisher.intern.logi-track.com> <416F0CE7.2000203@amazon.com.br>
* 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