The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
XmlConvert::ToDateTime Method (String^, XmlDateTimeSerializationMode)
.NET Framework (current version)
Converts the String to a DateTime using the XmlDateTimeSerializationMode specified
Assembly: System.Xml (in System.Xml.dll)
public: static DateTime ToDateTime( String^ s, XmlDateTimeSerializationMode dateTimeOption )
Parameters
- s
-
Type:
System::String^
The String value to convert.
- dateTimeOption
-
Type:
System.Xml::XmlDateTimeSerializationMode
One of the XmlDateTimeSerializationMode values that specify whether the date should be converted to local time or preserved as Coordinated Universal Time (UTC), if it is a UTC date.
| Exception | Condition |
|---|---|
| NullReferenceException | s is null. |
| ArgumentNullException | The dateTimeOption value is null. |
| FormatException | s is an empty string or is not in a valid format. |
Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Show: