I am trying to keep constraint on date and time. I want that if user tries to set date less than current date then it should show alert, and same thing is to be done with ti
Create a new Date object this way:
Date now = new Date(System.currentTimeMillis());
and use int result = now.compareTo(theOtherDate);
int result = now.compareTo(theOtherDate);
result will be an int < 0 if now Date is less than the theOtherDate Date, 0 if they are equal, and an int > 0 if this Date is greater.