+1 vote
32 views
by (163k points)

I have created this but getting an error>> "Condition expression must be of type Boolean: String"

public static boolean validateDateFormat(String date1){
    DateTime validDate  = DateTime.valueOf((date1);
        if(validDate.format('mm/dd/yyyy')){
            return true;
        }
        else{
            return false;
        }
        
}

1 Answer

Welcome to Memory Exceeded, where you can ask questions and receive answers from other members of the community.
You can donate any amount for Orphans village using following QR Code.
...