Re: Inserting the wrong date - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Inserting the wrong date
Date
Msg-id 43D7F89F.2070503@opencloud.com
Whole thread Raw
In response to Inserting the wrong date  (Lucas Sanabio <lsanabio@gmail.com>)
List 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

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Socket read fails
Next
From: David Hustace
Date:
Subject: Re: Socket read fails