Convert.ToBoolean Method (DateTime)

 

Calling this method always throws InvalidCastException.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

static member ToBoolean : 
        value:DateTime -> bool

Parameters

value
Type: System.DateTime

The date and time value to convert.

Return Value

Type: System.Boolean

This conversion is not supported. No value is returned.

Exception Condition
InvalidCastException

This conversion is not supported.

The following example demonstrates that an attempt to convert a DateTime value to a Boolean type throws InvalidCastException.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: