NullableTypes Class Library

NullableString.ToNullableDateTime Method 

Converts this NullableString structure to NullableDateTime.

[Visual Basic]
Public Function ToNullableDateTime() As NullableDateTime
[C#]
public NullableDateTime ToNullableDateTime();

Return Value

A new NullableDateTime structure containing the date value represented by this NullableString structure.

Remarks

This NullableString structure is parsed using the formatting information in a DateTimeFormatInfo initialized for the current culture. This method attempts to parse this NullableString completely and avoid throwing FormatException. It ignores unrecognized data if possible and fills in missing month, day, and year information with the current time. If s contains only a date and no time, this method assumes 12 A.M. Any leading, inner, or trailing white space character is ignored. Parameter s must contain the representation of a date and time in one of the formats described in the DateTimeFormatInfo topic.

Exceptions

Exception TypeCondition
FormatException this NullableString structure does not contain a valid string representation of a date and time.

See Also

NullableString Class | NullableTypes Namespace | Parse