System.Xml.XmlConvert.ToString Method

Converts the DateTime to a string.

Syntax

public static string ToString (DateTime value, string format)

Parameters

format
The format structure that defines how to display the converted string. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets.
value
The value to convert.
format
The format structure that defines how to display the converted string. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets.

Returns

A string representation of the DateTime in the specified format.

Remarks

This method calls value.ToString(format, System.Globalization.DateTimeFormatInfo.InvariantInfo).

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0