[daisy] [JIRA] Created: (DSY-577) Date Fields skip a day when set with daisy-api running on different system.

Marc Portier (JIRA) issues at cocoondev.org
Thu Nov 8 03:44:29 CST 2007


Date Fields skip a day when set with daisy-api running on different system.
---------------------------------------------------------------------------

         Key: DSY-577
         URL: http://issues.cocoondev.org//browse/DSY-577
     Project: Daisy
        Type: Bug
  Components: Repository  
    Versions: 2.1, 2.0.1    
 Reporter: Marc Portier


When setting fields of type 'date' (not datetime) we experience strange offsets between dates entered, and retrieved again after save: some saved days appear to be shifted to the previous day (and some don't!)

Since this only happens when client and server VM are running on different systems (OS's) we are lead to believe that this is caused by 

Some initial investigation showed that this is actually happening:

[1] document creation

* user enters date 12/04/1976 
* this is put into a Java Date object that sets the time to midnight in the local timezone: e.g. 15/04/1976 00:00 GMT+2
* during save this is sent in the XML file over as 1976-04-15+02:00

* on the server this is received and converted to the relevant time-spot in the local timezone (assuming GMT+1) this becomes: 14/04/1976 23:00 GMT+1
* the time-fragment is ignored here and 14-04-1976 is what is actually being stored


[2] document retrieval

* the same document is retrieved from the server and the stored date gets put in a Java Date object with time to midnight in the local timezone: 14/04/1976 00:00 GMT+1
* send over in the XML as 1976-04-14+01:00
* and converted eventually at the client' side into the equivalent on the local timezone: 14/04/1976 01:00 GMT+1 

displayed to the user this gives: 14/04/1976 one day earlier then the entered 15/04/1976.




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list