Groovy - après ()

Teste si cette date est postérieure à la date spécifiée.

Syntaxe

public boolean after(Date when)

Paramètres

Quand - La date à comparer.

Return Value- Vrai si et seulement si l'instant représenté par cet Dateobjet est strictement postérieur à l'instant représenté parwhen; false autrement.

Following is an example of the usage of this method −

class Example {
   static void main(String[] args) {
      Date olddate = new Date("05/11/2015");
      Date newdate = new Date("05/12/2015");
      Date latestdate = new Date();
		
      System.out.println(olddate.after(newdate)); 
      System.out.println(latestdate.after(newdate));
   } 
}

When we run the above program, we will get the following result −

false 
true