Le 17/09/2010 17:05, Adrian Crum a écrit :
A quick reminder to the rest of the community: UtilDateTime methods
that perform millisecond arithmetic should not be used.
I understand that 24*60*60*1000 it's bad, but for my culture, Why
millisecond arithmetic should not be used ? If you have just a link ;)
Nicolas
-Adrian
On 9/17/2010 3:40 AM, [email protected] wrote:
Author: ashish
Date: Fri Sep 17 10:40:20 2010
New Revision: 998061
URL: http://svn.apache.org/viewvc?rev=998061&view=rev
Log:
Correcting the condition. Thanks Akash for the contribution.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=998061&r1=998060&r2=998061&view=diff
==============================================================================
---
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
(original)
+++
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
Fri Sep 17 10:40:20 2010
@@ -76,7 +76,7 @@ public class UtilDateTime {
}
public static int getIntervalInDays(Timestamp from, Timestamp
thru) {
- return thru != null ? (int) (thru.getTime() -
from.getTime()) / (24*60*60*1000) : 0;
+ return thru != null ? (int) ((thru.getTime() -
from.getTime()) / (24*60*60*1000)) : 0;
}
public static Timestamp addDaysToTimestamp(Timestamp start, int
days) {
--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/