I have an Identity
class with necessary accessors and mutators.
In a seperate program I am comparing the Identity's Date to todays date which always returns <= 10
. However when I go to print it I get the same result no matter what the date is. Is there a different way to access the correct date?
I need to get the number of days between two dates and I'm having trouble on the formating:
Date today = new Date();
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
Date a = df.parse("06/18/2015");
Date b = df.parse("01/04/2015");
Date c = df.parse("02/04/2015");
Date d = df.parse("03/04/2015");
Date e = df.parse("07/04/2015");
if(a.compareTo(today) == 30{
//do stuff
}
I've tried multiple methods to no avail.