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