Windows apps
Collapse the table of content
Expand the table of content
Information
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::ToString Method (DateTime, XmlDateTimeSerializationMode)

 

Converts the DateTime to a String using the XmlDateTimeSerializationMode specified.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

public:
static String^ ToString(
	DateTime value,
	XmlDateTimeSerializationMode dateTimeOption
)

Parameters

value
Type: System::DateTime

The DateTime value to convert.

dateTimeOption
Type: System.Xml::XmlDateTimeSerializationMode

One of the XmlDateTimeSerializationMode values that specify how to treat the DateTime value.

Return Value

Type: System::String^

A String equivalent of the DateTime.

Exception Condition
ArgumentException

The dateTimeOption value is not valid.

ArgumentNullException

The value or dateTimeOption value is null.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2017 Microsoft