Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
computeDifference??
markcheung
I do not get the part with iUnit (5=days? 4=hours?)
public static final double computeDifference(CDateTime cdt1,
CDateTime cdt2,
int iUnit)
Computes the difference between two given datetime values as a fraction for the requested field.
Parameters:
cdt1 - The first datetime value
cdt2 - The second datetime value
iUnit - The field with respect to which the difference is being computed as a fraction
Returns:
The fractional difference between the two specified datetime values
Code:
System.out.println(cstart.toString());
System.out.println(cend.toString());
System.out.println(CDateTime.computeDifference(cend, cstart,-1));//???
System.out.println(CDateTime.computeDifference(cend, cstart,1));//???
System.out.println(CDateTime.computeDifference(cend, cstart,2));//???
System.out.println(CDateTime.computeDifference(cend, cstart,3));//???
System.out.println(CDateTime.computeDifference(cend, cstart,4));//???
System.out.println(CDateTime.computeDifference(cend, cstart,5));//???
System.out.println(CDateTime.computeDifference(cend, cstart,6));//???
System.out.println(CDateTime.computeDifference(cend, cstart,7));//???
System.out.println(CDateTime.computeDifference(cend, cstart,8));//???
---
Printout:
07-15-2007 12:00:00
07-31-2007 12:00:00
0.0
0.04380561259411362
0.5256673511293635
2.2857142857142856
0.0
16.0
0.0
0.0
0.0
Find more posts tagged with
Comments
There are no comments yet