[ 
https://jira.duraspace.org/browse/DS-775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19952#action_19952
 ] 

Mark H. Wood commented on DS-775:
---------------------------------

I still don't understand.  The (possibly erroneous) system time does not 
participate in the multiplication.  If accurate time is T and system time is 
T+E, then the calculated lift date would be T+E+(D*24*60*60*1000) while the 
expected lift date would be T+(D*24*60*60*1000).  IOW the lift date should be 
off by the same amount as the system time:  E.

Also, *any* function which deals in time and does not implement an independent 
external reference (such as its own NTP connection) is utterly dependent on the 
OS' local time service.  If Date is wrong then Calendar should be wrong by the 
same amount.  Something else must have been happening.

How large an interval were you specifying?  DayTableEmbargoSetter won't 
necessarily give you the same date a year hence if you specify something like 
"One year:365" because there's no way to express a year as a fixed number of 
days:  leap years throw this off.  It's been suggested in conversation that 
perhaps you really want a YearTableEmbargoSetter which takes an offset in years 
and could use Calendar to correctly account for leap years, but that has no 
connection with System.currentTimeMillis().

> Implementation of DayTableEmbargoSetter.java not working as expected.
> ---------------------------------------------------------------------
>
>                 Key: DS-775
>                 URL: https://jira.duraspace.org/browse/DS-775
>             Project: DSpace
>          Issue Type: Bug
>          Components: DSpace API
>    Affects Versions: 1.7.0
>            Reporter: Tim Ribaric
>            Assignee: Mark H. Wood
>            Priority: Major
>         Attachments: DayTableEmbargoSetter_mod.java
>
>
> The original implementation of DayTableEmbargoSetter.java worked by grabbing 
> the system time in milliseconds computing the embargo period in milliseconds 
> adding the two and then casting into a Date.  For whatever reason this never 
> calculates correctly in all the test cases I attempted.  I rewrote a few 
> lines of the class to instead use a Calendar offset to figure out the Lift 
> Date.  I think this is a more reliable implementation but I'm happy to hear 
> what others say.

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

        

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to