Im working on a program which tells if the last modified date of a file is in the range of the date From and date To and if it is inside the range it will copy but im having an error
File src = new File(sourcefile + File.separator + strErrorFile[i]);
if(sourcefile.isDirectory())
{
ArrayList<Integer> alDateList = date(strList1);
int intDateFrom1 = alDateList.get(0);
int intDateTo1 = alDateList.get(1);
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
System.out.println("After Format : " + sdf.format(src.lastModified()));
try
{
lastDate = Integer.parseInt(sdf.format(src.lastModified())); //line 362
} catch (NumberFormatException e) {
e.printStackTrace();
}
if(intDateFrom1 <= lastDate && intDateTo1 >= lastDate)
{
//copy
}
}
error
java.lang.NumberFormatException: For input string: "09/10/2015"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.eclipse.wb.swt.FortryApplication$4.widgetSelected(FortryApplication.java:362)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.wb.swt.FortryApplication.open(FortryApplication.java:56)
at org.eclipse.wb.swt.FortryApplication.main(FortryApplication.java:610)