Converts a string to a date value.
[Visual Basic] Public Shared Function ToDate( _ ByVal value As String _ ) As DateTime [C#] public static DateTime ToDate( string value ); [C++] public: static DateTime ToDate( String* value ); [JScript] public static function ToDate( value : String ) : DateTime;
The date value represented by the string.
Exception Type | Condition |
---|---|
XmlException | If value is null or a reference to a string that does not contain a valid date value. |
The value parameter must be a non-null reference to a string that contains a well-formed date. The string must be of the form YYYY-MM-DD, where YYYY is the year (0001-9999), MM is the month (01-12), and DD is the day (01-31).
XmlString Class | XmlString Members | System.Xml Namespace | FromDate