On 4/18/2009 10:37 AM, Darren Norris wrote:
 I have a little database (attached) and the dates in one of the tables
 (I haven't checked others) change when the file is copied between
 different laptops.

The data doesn't change - the representation does - see below.
........
........
 Darren


Hi Darren,


Most likely it is Time Zone differences with the user local.

HSQLdb does not have a timezone component (not that most DBMS' do) to date or time types. Actually to be more precise I change that to - HSQLdb stores time with only one timezone - UTC 0 Your local time zone settings (your OS settings) are used to convert this value when it is used in a recordset. (such as displayed in a form or on a report)

To see this in action you simply need to enter a date value - exit OO.o - change your timezone in your OS - restart OO.o, open the file and view that date/time again.

Here is the comment about this from the HSQLdb source file for timestamps:
57 * HSQLDB uses the client and server's default timezone for all
DATETIME
58 * operations. It stores the DATETIME values in .log and .script
files using
59 * the default locale of the server. The same values are stored as
binary
 60  * UTC timestamps in .data files. If the database
 is trasported from one
61 * timezone to another, then the DATETIME values in cached tables
will be
62 * handled as UTC but those in other tables will be treated as
local. So
63 * a timestamp representing 12 noon stored in Tokyo timezone will
be treated
64 * as 9 pm in London when stored in a cached table but the same
value stored
 65  * in a memory table will be treated as 12 noon.

(*NOTE* - for Base embedded files the tables are 'cached' tables, as referred to above )

So the top question is, I suppose, "How do you need to handle that, for your particular application?

What about these:
Is it enough to know that the times each of you are seeing are relative to your locale? You don't input date/time data for a different timezone the your OS is configured for, do you?

 Question is - is there any way to ensure for whatever reason (different
 OS, timezone, base version , openoffice settings etc) that a date or a
 time remains exactly as entered (without inputting as text)? If not
 where should I start looking to make sure dates remain the same (there
 are 3 different people all with vista laptops and the .odb file will be
 emailed, copied via cd / usb between us).

Should be, shouldn't there? (thinking...)

Kind of OT - this is true for the version of HSQLdb shipped with OO.o, version 1.8.x. The alpha release of HSQLdb 1.9 adds two new data types to address this particular situation with "TIME WITH TIME ZONE and TIMESTAMP WITH TIME ZONE". Whether Base will be supporting the newer HSQLdb engine(s) [2.0 is also in the works] is something I have not seen mentioned before.

Best wishes,


Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to