db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Moving a Derby database across timezones
Date Sun, 09 Mar 2008 01:51:37 GMT
Alan Burlison wrote:
> I have been looking at the derby documentation for TIMESTAMP, and it's 
> pretty confusing when it comet to try to figure what will happen if I 
> move a database onto a machine in a different timezone.
> 
> http://db.apache.org/derby/papers/JDBCImplementation.html#Derby+SQL+TIMESTAMP 
> 
> 
> ----------
> Derby’s SQL TIMESTAMP type represents a time of day in the form 
> yyyy-mm-dd hh:mm:ss.fffffffff (nanosecond granularity) with no 
> associated time zone information.
> 
> java.sql.Timestamp
> 
> A JDBC Timestamp (java.sql.Timestamp) by definition represents a point 
> in time, with nanosecond resolution, in a given time zone.
> ----------
> 
> So what does "no associated timezone information" mean?  Does Derby 
> normalize all timestamps to UTC, or does it just throw away the timezone 
> information altogether?   If it is the second, that makes it impossible 
> to move databases across timezones without having to recalculate any 
> timestamps it uses.

It is the second, which is defined by the SQL standard which has 
datetime values with and without timezone. In SQL terms (section 4.6 of 
the SQL standard foundation document) Derby's TIMESTAMP is

   TIMESTAMP WITHOUT TIME ZONE

Dan.


Mime
View raw message