NSTimestamp.IntRef days=new NSTimestamp.IntRef(); now.gregorianUnitsSinceTimestamp( null, null, days, null, null, null, dateFromQueryMin); int d=days.value;
int d = (int)ERXTimestampUtility.differenceByDay(now, dateFromQueryMin);
    public Object date() {        int found=0;        NSTimestamp dateFromQueryMin=(NSTimestamp)displayGroup.queryMin().valueForKey(key);        if (dateFromQueryMin!=null) {            NSTimestamp now=new NSTimestamp();            NSTimestamp.IntRef days=new NSTimestamp.IntRef();            now.gregorianUnitsSinceTimestamp( null,                                              null,                                              days,                                              null,                                              null,                                              null, dateFromQueryMin);            int d=days.value;            if (d>0) {                for (int i=0;i<daysAgoArray.length-1;i++) {                    if (d>=daysAgoArray[i] && d<= daysAgoArray[i+1]) {                        found=i+1;                        break;                    }                }            }        }        return indexes.objectAtIndex(found);    }