DateTime::IConvertible::ToType Method
Silverlight
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Converts the current DateTime object to an object of a specified type.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Parameters
- type
- Type: System::Type
The desired type.
- provider
- Type: System::IFormatProvider
An object that implements the IFormatProvider interface. (This parameter is not used; specify nullptr.)
Return Value
Type: System::ObjectAn object of the type specified by the type parameter, with a value equivalent to the current DateTime object.
Implements
IConvertible::ToType(Type, IFormatProvider)| Exception | Condition |
|---|---|
| ArgumentNullException | type is nullptr. |
| InvalidCastException | This conversion is not supported for the DateTime type. |
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Community Additions
ADD
Show: