public static boolean isDateInThePast ( final Date date ) { boolean inPast = false ; final Calendar compare = Calendar . getInstance ( ) ; compare . setTime ( date ) ; final Calendar now = Calendar . getInstance ( ) ; now . setTime ( new Date ( System . currentTimeMillis ( ) ) ) ; inPast = now . after ( compare ) ; return inPast ; }
Checks if the given date object is in the past .