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