find milliseconds
I'm getting two dates in the driver class and passing those string object to DateParser class.
In DateParse class I have to find the millisecs of those dates and calculate the difference .I dont know how to proceed.
import java.text.*;
import java.util.*;
import java.lang.String;
publicclass DateParser{
private String date;
privateint month;
privateint day;
privateint year;
public DateParser(String strObj){
date = strObj;
parseString();
}
publicvoid parseString()throws Exception{
DateFormat dateFormat =new SimpleDateFormat ("MM/dd/yyyy");
Date birthDate = dateFormat.parse (date);
Calendar calDate = Calendar.getInstance();
calDate.setTime (birthDate);
int d = calDate.get (Calendar.DAY_OF_MONTH);
int m = calDate.get (Calendar.MONTH);
int y = calDate.get (Calendar.YEAR);
setMonth(m);
setDay(d);
setYear(y);
long ms = calculateMillisecs();
}
publicvoid setMonth(int mm){month = mm - 1;}
publicvoid setDay(int dd){day = dd;}
publicvoid setYear(int yy){year = yy;}
publiclong calculateMillsecs(){
GregorianCalendar gdate =new GregorianCalendar(year,month,day);
}
}

