StrToNullDateTime string

.StrToNullDateTime()

Takes a string containing a DateTime and converts it to a DateTime? type.

Method

public static DateTime? StrToNullDateTime(this string value)
string value

The string to convert to a DateTime?.

Example

C#
DateTime? x = "1 Jan 2000".StrToNullDateTime();
C#
DateTime? x = "".StrToNullDateTime();