You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andy Seaborne <an...@apache.org> on 2015/01/02 19:46:02 UTC

The mystery of time (JDBC tests)

Rob,

The JDBC tests in AbstractJenaStatementTests have triggered a Java issue 
(!!!!).

Why it's happen now, I don't know but I have a new machine.  Or it maybe 
it has not been compiled locally since the end of summer time (this may 
matter!)

My /etc/timezone is "Europe/London"

The tests use:

new java.sql.Time(0,0,0,) ;

SQL Time extends java.util.Date

so far so good - that's the start of the epoch.

http://stackoverflow.com/questions/1238172/why-does-an-hour-get-added-on-to-java-util-date-for-dates-before-nov-1-1971

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4832236

But the UK was on +1 hour (an experiment) on 1970-01-01 and Java uses 
the current timezone name to work out the timezone name back then.  It 
calls it GMT ... but it's not.

The effect is that Jan 1, 1970 Europe/London is one hour out.

The test for a time of 00:00:00.

Proposed solution; force the timezone to UTC for the tests.  (This is 
committed for review)

Maybe related to the forced use of Java 1.6 but that itself cause the 
code to stop compiling somehow (it found an AutoCloseable).

All praise stackoverflow.

	Andy

Re: The mystery of time (JDBC tests)

Posted by Rob Vesse <rv...@dotnetrdf.org>.
Forcing a time zone for the tests makes sense to me

Rob

On 02/01/2015 18:46, "Andy Seaborne" <an...@apache.org> wrote:

>Rob,
>
>The JDBC tests in AbstractJenaStatementTests have triggered a Java issue
>(!!!!).
>
>Why it's happen now, I don't know but I have a new machine.  Or it maybe
>it has not been compiled locally since the end of summer time (this may
>matter!)
>
>My /etc/timezone is "Europe/London"
>
>The tests use:
>
>new java.sql.Time(0,0,0,) ;
>
>SQL Time extends java.util.Date
>
>so far so good - that's the start of the epoch.
>
>http://stackoverflow.com/questions/1238172/why-does-an-hour-get-added-on-t
>o-java-util-date-for-dates-before-nov-1-1971
>
>http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4832236
>
>But the UK was on +1 hour (an experiment) on 1970-01-01 and Java uses
>the current timezone name to work out the timezone name back then.  It
>calls it GMT ... but it's not.
>
>The effect is that Jan 1, 1970 Europe/London is one hour out.
>
>The test for a time of 00:00:00.
>
>Proposed solution; force the timezone to UTC for the tests.  (This is
>committed for review)
>
>Maybe related to the forced use of Java 1.6 but that itself cause the
>code to stop compiling somehow (it found an AutoCloseable).
>
>All praise stackoverflow.
>
>	Andy