This code works as it should (subtracting the days between 2 dates), but it shows as an error in Eclipse and I'm trying to figure out how to clean it up so it doesn't give an error. I didn't write the code, btw....
<c:set var="start" value="${move.moveStart}"/>
<jsp:useBean id="start" type="java.lang.String"/>
<c:set var="end" value="${move.moveEnd}"/>
<jsp:useBean id="end" type="java.lang.String"/>
<%
int days = 0;
try{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date dstart = sdf.parse(start);
Date dend = sdf.parse(end);
long milsecs = dend.getTime() = dstart.getTime();
days = (int)(milsec/(1000*60*60*24));
}catch(ParseException pe){
;
}
%>
I'm getting the errors on the sdf.parse(start) and .(end) that it "cannot be resolved to a variable". What am I missing here?