Created
November 3, 2011 13:47
-
-
Save aziz781/1336521 to your computer and use it in GitHub Desktop.
Java: is Current date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isCurrentDate(Date givenDate) | |
{ | |
// current date | |
Calendar currentCal = Calendar.getInstance(); | |
currentCal.setTime(getCurrentDate()); | |
// given date | |
Calendar givenCal = Calendar.getInstance(); | |
givenCal.setTime(givenDate); | |
if(currentCal.equals(givenCal)) | |
return true; | |
else | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment