Skip to content

Instantly share code, notes, and snippets.

@aziz781
Created November 3, 2011 13:47
Show Gist options
  • Save aziz781/1336519 to your computer and use it in GitHub Desktop.
Save aziz781/1336519 to your computer and use it in GitHub Desktop.
Java: is Future Date
public static boolean isFutureDate(Date givenDate)
{
// current date
Calendar currentCal = Calendar.getInstance();
currentCal.setTime(getCurrentDate());
// given date
Calendar givenCal = Calendar.getInstance();
givenCal.setTime(givenDate);
if(currentCal.equals(givenCal) || currentCal.after(givenCal))
return false;
else
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment