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.FromString

Creates a DateTime from a String.

[Visual Basic]
Public Shared Function FromString( _
   ByVal s As String _
) As DateTime
[C#]
public static DateTime FromString(
   string s
);
[C++]
public: static DateTime FromString(
   String* s
);
[JScript]
public static function FromString(
   s : String
) : DateTime;

Parameters

s
A string value containing the date and time in the current locale format.

Return Value

A new DateTime value.

Exceptions

Exception Type Condition
ArgumentException If s is a null reference (in Visual Basic Nothing).
FormatException If s does not contain a valid string representation of a date and time.

Remarks

The DateTime string must specify a date and, optionally, a time in the format required by the current locale. Use either the universal FromString or locale-specific Parse.

The output of ToString must be consumable by FromString.

See Also

DateTime Structure | DateTime Members | System Namespace | String | CultureInfo