dynamobi/dynamobi — Issue #600: [FRG-272] timestamps should not be converted to DateTimeUtil.defaultZone
Author: dynamobi-build
Created: 2011-12-30 03:37:45+00:00
State: open
Labels: FRG, Runtime

[reporter="mberkowitz", created="Wed, 23 May 2007 12:39:11 -0500 (GMT-05:00)"]
In some cases runtime routines convert a timestamp from UTC to a "default timezone",

using org.eigenbase.util14.DateTimeUtil.defaultZone, which is initialized to the java default

timezone. This affects AbstractResultSet and SqlDateTiimeWithoutTZ.

This behavior seems incorrect:

- sql timestamps are zoneless, so AbstractResultSet.getTimestamp(int col) should

return a "zoneless value", which is naturally represented as a Timestamp whose

getTime() matches the timestamp value as UTC (no zone shift).

- ResultSet.getTimestamp(int col, Calendar null) is spec'd to convert to the caller's default zone,

which is more likely the zone of the client session,not the server.

- in a distributed system there is no single well-defined server timezone

- due to DST, the server timezone offset depends on the current date, not the value of the timestamp

being shifted.

Why not remove DateTimeUtil.defaultZone and always keep timestamps as UTC on the server?

To support ResultSet.getTimestamp(int, Calendar null), need to provide the client timezone as a

session attribute -- cannot assume it is the same as the server zone.