Converts this instance of a Decimal to a DateTime object.
[Visual Basic] Overridable Public Function ToDateTime() As DateTime [C#] public virtual DateTime ToDateTime(); [C++] public: virtual DateTime ToDateTime(); [JScript] public function ToDateTime() : DateTime;
A DateTime.
Exception Type | Condition |
---|---|
InvalidCastException | is thrown if it doesn't return a DateTime. |
The ToDateTime method returns a DateTime.
This method implements IConvertible, which replaced IValue. This method is used to obtain the type code for a specified object. (See Convert and Value for more information about conversions; see the Type for more information about types.)