I am doing a leave management program, when the user apply a leave, I need to make sure the from date matches the application days for example -7 for apply in advance. So, I need to use the system date to subtract the from date to get the days between the two dates. How to do so?
System.out.print("From date(YYYY-MM-DD): ");
this.fromDate = sc.nextLine();
LocalDate systemDate = LocalDate.now();
LocalDate date = LocalDate.parse(this.fromDate, DateTimeFormatter.ISO_LOCAL_DATE);
File filelvT = new File("./leaveType/" + this.leaveTypeID + ".txt");
try(BufferedReader bRlvT = new BufferedReader(new FileReader(filelvT))){
String line = bRlvT.readLine();
String[]value = line.split(";");
//the value[4] is the application days recorded in the particular txt file
if( ? < value[4]){ //so what should I write in the ?
} //end if
}catch(IOException err){
err.printStackTrace();
}