Converts this instance into an Int32.
[Visual Basic] Overridable Public Function ToInt32() As Integer [C#] public virtual int ToInt32(); [C++] public: virtual int ToInt32(); [JScript] public function ToInt32() : int;
The Int32 value for this instance.
Exception Type | Condition |
---|---|
InvalidCastException | If this DateTime is not an Int32 value. |
The ToInt32 method casts this DateTime instance into an Int32 value. An exception is thrown if this instance cannot be coerced into an 32-bit signed integer (int).
DateTime Structure | DateTime Members | System Namespace | Int32 | UInt32