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