Skip site navigation (1) Skip section navigation (2)

Re: Two millisecond timestamp offset

From: Vadim Nasardinov <vadimn(at)redhat(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Two millisecond timestamp offset
Date: 2005-09-09 15:11:39
Message-ID: 200509091111.39630.vadimn@redhat.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Friday 09 September 2005 07:18, Adrian Cox wrote:
> I couldn't find anything on this with Google, but I've got a 2ms
> offset between the java.sql.Timestamp representation and the string
> representation of a "timestamp with time zone".
> 
> I've tried the following JDBC releases: 8.1dev-401 JDBC 3, 8.0-312
> JDBC 3, pg74.216.jdbc3.jar. The server is the Debian package

Since you're a Debian user, there is a greater-than-zero chance you
may be using a free java runtime like GCJ or some such.  If so, it
would be helpful if you could also mention the version of GCJ that
you're using.  In old versions of GNU Classpath, the implementation of
java.sql.Timestamp was buggy.  (It's a little tricky to get right due
to the fact that the fractional seconds - the "nanos" - are separate
from whole seconds.  Care must be taken when converting this slightly
schizophrenic internal representation to/from milliseconds.)

The only specific bug I remember is this one:
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16574

There might have been others.

In response to

pgsql-jdbc by date

Next:From: Dave CramerDate: 2005-09-11 23:11:49
Subject: Re: TimestampUtils.loadCalendar failes for interval type
Previous:From: Adrian CoxDate: 2005-09-09 15:03:25
Subject: Re: Two millisecond timestamp offset

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group