Re: Two millisecond timestamp offset - Mailing list pgsql-jdbc

From Adrian Cox
Subject Re: Two millisecond timestamp offset
Date
Msg-id 1126278205.3069.102.camel@localhost
Whole thread Raw
In response to Re: Two millisecond timestamp offset  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
On Sat, 2005-09-10 at 02:25 +1200, Oliver Jowett wrote:
> The JDBC driver will use the JVM's default timezone to format dates
> unless you explicitly pass a Calendar to setTimestamp() etc, so if that
> timezone is mysteriously 2ms out then it'd explain the strange behaviour
> you see.

Thanks for the clue. There was an error in the code that built the
shared SimpleTimeZone object used for all the date calculations. It was
cut and pasted in from some broken reference code:

new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC");

The value of SimpleTimeZone.UTC_TIME is actually 2, leading to a
mysterious two millisecond offset.

--
Adrian Cox <adrian@humboldt.co.uk>


pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Two millisecond timestamp offset
Next
From: Vadim Nasardinov
Date:
Subject: Re: Two millisecond timestamp offset