Re: Inserting the wrong date

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: lucas(at)marx(dot)com(dot)br
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Inserting the wrong date
Date: 2006-01-25 22:15:59
Message-ID: 43D7F89F.2070503@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Lucas Sanabio wrote:
> Hi everyone! I'm having an problem when I try to insert data into a
> timestamp field, let me try to explain what is going in on.
>
> I developed my application at my local machine and at this machine
> everything is working as it should, but when I deployed the application
> into the production server, every time I save an timestamp it saves it
> one hour before. The method that is inserting the data is pasted below:

What is the actual value inserted?

I'd guess that your client and server timezone do not match, so that
(for example) 2006-01-12 12:00:00 in the client's default timezone is
2006-01-12 12:00:00 +0100; if the server timezone is +0200 then this
will be represented as 2006-01-12 13:00:00 +0200 (which is the same
instant in time).

If the actual value inserted is wrong, the first thing I would do is to
try a recent driver as I did a number of time-and-date-related fixes
relatively recently. What driver version are you currently using?

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Hustace 2006-01-25 23:18:02 Re: Socket read fails
Previous Message Oliver Jowett 2006-01-25 22:12:16 Re: Socket read fails