Argentini.Halide.H3Identify.IsDate C# (CSharp) Method

IsDate() public static method

Determines if a string value is a valid date.
public static IsDate ( string input ) : System.Boolean
input string The string to process.
return System.Boolean
        public static Boolean IsDate(string input)
        {
            Boolean retVal = false;

            if (!String.IsNullOrEmpty(input))
            {
                try
                {
                    DateTime dt = Convert.ToDateTime(input);
                    retVal = true;
                }

                catch
                {
                    retVal = false;
                }
            }

            return retVal;
        }