Converts this instance to a DateTime value
[Visual Basic] Overridable Public Function ToDateTime() As DateTime [C#] public virtual DateTime ToDateTime(); [C++] public: virtual DateTime ToDateTime(); [JScript] public function ToDateTime() : DateTime;
The DateTime value for this instance.
Exception Type | Condition |
---|---|
InvalidCastException | If this DateTime is not a DateTime. |
The ToDateTime method casts this DateTime instance into another DateTime value. An exception is thrown if the current instance of DateTime cannot be coerced into a DateTime.