The date is displayed as Date: November 27, 2021. I need to ensure this is greater than current date. Can anyone share code for this plz.
            Asked
            
        
        
            Active
            
        
            Viewed 476 times
        
    0
            
            
        - 
                    Please share the code what you have tried. – Nandan A Nov 18 '21 at 08:35
 - 
                    I'm new to java and selenium, i have 0 idea of how to go about this at all. So have no code – Newtoselenium Nov 18 '21 at 08:35
 - 
                    Does this answer your question? https://stackoverflow.com/questions/19726115/comparing-user-input-date-with-current-date – Nandan A Nov 18 '21 at 08:41
 
1 Answers
0
            
            
        I've obtained what you need with this code:
SimpleDateFormat formatter1=new SimpleDateFormat("MMM dd, yyyy");  
Date coursedate1=formatter1.parse(newdate);  
System.out.println(coursedate1);
SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy");  
Date today = new Date();  
System.out.println(formatter.format(today));  
        ufo
        
- 674
 - 2
 - 12
 - 35
 
        Newtoselenium
        
- 33
 - 1
 - 5