Re: Two millisecond timestamp offset

From: Adrian Cox <adrian(at)humboldt(dot)co(dot)uk>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Two millisecond timestamp offset
Date: 2005-09-09 15:03:25
Message-ID: 1126278205.3069.102.camel@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)humboldt(dot)co(dot)uk>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vadim Nasardinov 2005-09-09 15:11:39 Re: Two millisecond timestamp offset
Previous Message Oliver Jowett 2005-09-09 14:25:36 Re: Two millisecond timestamp offset