I have a Product class, which has a Date variable that represents the expiration date, now I want to check if the product is in the last expiration of the week. All I could do was find out if there is a date before or after the expiration date, but I want to find out exactly how many days to check if it missed last week.
...
Date dv = new Date();
if (dv.after(vexp))
return false;
else
return true; }
...
How can I change this part of my code to make it work?
EDIT sry I mean "week" as 7 days, so I need to check if it is in the last 7 days from the expiration date
source
share