Benny Sutton is 4 hire - just click here

Validate Value is a date

Convenient way to DateTime.TryParse into a DateTime

           
       public static bool IsDate(this string input)
        {
            if (!string.IsNullOrEmpty(input))
            {
                return DateTime.TryParse(input, out _);
            }
            else
            {
                return false;
            }
        }
 
    

Returns true/false - call like this...

         
            DateToCheck.IsDate();