On 15 Mar 2011 at 15:56, Alexander Krasnukhin wrote:

> > a)  *two* timezone conversions need to be covered:
> > datastore <-> system <-> UI
> > In general, the datastore and system will have the same timezone, but
> > this must not be *assumed* to be the case.
> 
> Yep, it must be defined somewhere explicitly.

Forgive me for being pedantic, but I want to repeat: You're 
recommending that *two* timezone conversions been to be 
considered: when (1) temporal data passes between "the system" and 
"the datastore" (since the datastore has an internal, configurable, 
timezone), and (2) when temporal data passes between "the system" 
and "the user interface".  



Typically, "the datastore" and "the system" will have the same 
timezone. Generally, "the user interface" will also have the same time 
zone. In exceptions, each of the above could have different timezones.

In this case, I would have to assume that it is intended that any 
*programmatically* create date/datetime is expected to use the "the 
system" timezone? Or should it use the logged-in user user time 
zone? 


I need to take some time to consider this and the implications.

Anyone else have any input?


> Moving the db is never a problem since it stores timezone within itself.
> Moving the server won't be problem only if it takes timezone from the db or
> always manually fixed after reallocation.
> 
> 
> > I am assuming that the development assumes that it is occuring in the
> > production environment (including timezone).
> >
> 
> Yeah, it makes sense.

Without giving it too much thought, to me, if I programmatically create 
a date Date testDate = new Date ("2011-03-15") [or whatever the 
precise syntax is] then when I inspect the underlying data structures, I 
expect to see a (in Java DateTime space) a cdate of "2011-03-15 
0h00". Yes?




On another note: If I want to fiddle with this: i.e. globally replace all 
references to the Java Date/Time/Calendar classes with JodaTime, I 
assume the recommended approach is to create a subversion 
branch?

Is this as simple as: 
sh> svn copy  https://svn.apache.org/repos/asf/incubator/isis/trunk \
 https://svn.apache.org/repos/asf/incubator/isis/branches/jodatime \
 -m "part one of Timezone saga - use JodaTime"

sh> svn up .../branches/jodatime

I list "trunk" above, but only a few sub-directories may be actually 
required (applib, runtime and datastore, for example).


Reply via email to