NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DateTime.ToString ()

Converts the date and time value of this instance to a string.

[Visual Basic]
Overloads Overrides Public Function ToString() As String
[C#]
public override string ToString();
[C++]
public: override String* ToString();
[JScript]
public override function ToString() : String;

Return Value

A string value containing the date and time represented by this instance.

Exceptions

Exception Type Condition
FormatException If the general format ("G") string is used.

Remarks

The ToString method uses InvariantCulture as the default. The output of ToString must be consumable by FromString.

An unexpected FormatException occurs while using the ToSring general format ("G") string when the general format DateTime string representation is not parsed correctly.

Note   ToString is formatted using the invariant culture (see InvariantCulture).

ToString converts the date and time value of this instance to a string value, then formats the return value determined by the InvariantCulture The format is " mm/dd/yy hh:mm:ss PP ", where:

See Also

DateTime Structure | DateTime Members | System Namespace | DateTime.ToString Overload List | String | CultureInfo | Calendar | DateTimeFormat | DateTimeFormatInfo