db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas <Thomas.K.H...@t-online.de>
Subject data base (server) timezone
Date Tue, 02 Mar 2010 09:46:23 GMT

as Derby currently does not support timezone aware date/time data types, 
my application that can run in local/embedded data base mode but also in
networked/network server mode needs to convert input dates into UTC before
storing (and back to local timezone if wanted when displaying stored 
As a start I have written a stored function accepting a timestamp and a 
timzone id that currently does the conversion. 
When running in network server mode the timezone to pass to the function is
clear, but in embedded mode the 'database server' timezone depends on 
the user timezone.

embedded data base mode:
How would I determine the timezone e.g. 'current_timestamp' function is 
refering to? Is there a function available for this? 
Would I need to write a java stored procedure using
java.util.TimeZone.getDefault() for this? 

network server mode:
Although I know the timezone when running in network server mode 
(and could sort of "hard code" it by putting the ID on a static data table),
would there be a more elegant way of retrieving the timezone in this scenario
as well? (maybe asystem property?)


View raw message