X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8DF0532BDD6 for ; Thu, 14 Oct 2004 09:02:21 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97250-07 for ; Thu, 14 Oct 2004 08:02:10 +0000 (GMT) Received: from mail.logi-track.com (burro.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 2E5EF32BDAF for ; Thu, 14 Oct 2004 09:02:09 +0100 (BST) Received: from kingfisher.intern.logi-track.com (G6ef9.g.pppool.de [80.185.110.249]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 3BE413009A; Thu, 14 Oct 2004 10:02:09 +0200 (CEST) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id 4C4E6AB100; Thu, 14 Oct 2004 10:02:02 +0200 (CEST) Date: Thu, 14 Oct 2004 10:02:01 +0200 From: Markus Schaber To: Jair da Silva Ferreira Jr Cc: pgsql-jdbc@postgresql.org Subject: Re: problem with dates when using a java calendar object Message-ID: <20041014100201.761efae5@kingfisher.intern.logi-track.com> In-Reply-To: <416DB991.3060809@amazon.com.br> References: <416DB991.3060809@amazon.com.br> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K wrote: > Hi, > I am experiencing the following problem with postgresql: the date=20 > value I insert into the database is different from the value I select=20 > from the database. I use a Calendar with a non-default timezone to set=20 > and get the date value (using methods=20 > PreparedStatement.setDate(int,Date,Calendar) and=20 > 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. HTH, Markus --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com