pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Cox <adrian@humboldt.co.uk>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Two millisecond timestamp offset
Date: Fri, 09 Sep 2005 16:03:25 +0100
Message-ID: <1126278205.3069.102.camel@localhost> (raw)
In-Reply-To: <43219B60.2050706@opencloud.com>
References: <1126264710.3069.76.camel@localhost>
	<43219B60.2050706@opencloud.com>

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>




view thread (4+ messages)  latest in thread

Message-ID: <1126278205.3069.102.camel@localhost>
Permalink:  ../1126278205.3069.102.camel@localhost/
Also on:    postgresql.org/message-id/1126278205.3069.102.camel@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: adrian@humboldt.co.uk, oliver@opencloud.com
  Subject: Re: Two millisecond timestamp offset
  In-Reply-To: <1126278205.3069.102.camel@localhost>
  References: <1126264710.3069.76.camel@localhost> <43219B60.2050706@opencloud.com> <1126278205.3069.102.camel@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox