// Get the difference in date and return to the number of days.
// Date format: 2005-01-01
// Author: meanson Wang
// email: meansonw@hotmail.com
Public static long getcomparedate (string startdate, string enddate) throws parseException {
SimpleDateFormat Formatter = New SimpleDateFormat ("YYYY-MM-DD");
Date Date1 = formatter.parse (startdate);
Date Date2 = formatter.parse (enddate);
Long L = Date2.gettime () - DATE1.GETTIME ();
Long D = L / (24 * 60 * 60 * 1000);
Return D;
}