I need a function to check a date with boolean. I have a String variable that stored one date. I stored date format is that “yyyy/mm/dd”. I need to check if this variable is a valid date. If the date format is true then the function needs to return true in java. But I need something. I shouldn’t use to convert string to integer. I have wrote something.
public boolean trueDate(String date){
String[] temp;
temp = date.split("/");
String year = temp[0];
String mounth = temp[1];
String day = temp[2];
}
What should i do?
1 Answer