Is there a simple way to validate a variable is a date?

In short client gives me a files and sometimes the DOB variable has a real date in it and other times it has text it in such as random or AdultMale.
What I would like to do is something simple like

If DOB is a date
// use this date
Else
// call handler to generate a date
End if

This if statement doesnt work since “a date” isnt valid but is there a simple way to do this without using some logic around contains only these characters or something. Trying to make it generic as possible

This should work in my opinion.

> set myDate to today
> put myDate
2025-08-29
> put myDate is a date
True

Maybe the format of the variable value is not recognised. You can define those with the “the timeInputFormat” global property. See the EPF documentation for more details.

Thanks.

I must have had a typo or something because I had swore I tried

If DOB is a date
do this

and I got an error but I went back and redid it and all was good so thanks for making me go back and retry :smile: