db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Burlison <Alan.Burli...@sun.com>
Subject Moving a Derby database across timezones
Date Sun, 09 Mar 2008 00:26:14 GMT
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.


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.


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.

Ideally I'd like all times to be stored by Derby in UTC, but I can't set 
the JVM timezone to UTC as the Derby database is running inside Tomcat, 
and such a change would affect *all* the webapps running in the web 

Alan Burlison

View raw message