Date StartDate= (Date)CurrentRow.getAttribute("StartDate");
Date CurrentDate = (Date)am.getOADBTransaction().getCurrentDBDate();
java.sql.Date sdate = (java.sql.Date) StartDate.dateValue();
java.sql.Date cdate = (java.sql.Date) CurrentDate.dateValue();
int days = daysBetween(sdate,cdate );
public int daysBetween(java.sql.Date d1, java.sql.Date d2){
return (int)( (d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
}
No comments:
Post a Comment