Hi I have to find out days difference b/w two dates .First one is current date and second Date i am taking from database.Actually i want to send Automatic email at difference of 90 days b/w these two dates . Java 1.6 is using in my Application.
I am using this code
for(BidderHeaderBean checkBean:tenderheadersbean){
Date currentdate=new Date();
String datePattern = "yyyy-MM-dd";
SimpleDateFormat df = new SimpleDateFormat(datePattern);
String bidopeningdate= MisUtility.convertDateToString(checkBean.getBidOpeningDate());
Date givenDate = df.parse(bidopeningdate);
Long last = givenDate.getTime();
Long current=currentdate.getTime();
Long timediff=last-current;
Long diffdays=timediff/(1000 * 60 * 60 * 24);
}
I am not getting difference of days.Please help me . Thanks & Regards Bhagwan singh