I have a method that is comparing a Date passed in to see if it is on or after today (fairly simple). So I create a Date object and initialize it with default constructor, which gives me the current Date and time.
if(dateParam.after(today) || dateParam.equals(today)) does not return the correct result if the date passed in is today. This is because the default date constructor gives me the current date but also the current time. So therefore if the param is 8/21/2014 and today is 8/21/2014 16:55:00:00 then these two are not equal.
What is the best way to ensure that it just compares the date portion and not the time portion? Is there a way to zero out the time on a date object? Or possibly a method that doesn't consider the time in comparison?
Thanks in advance for your help!!