SyntaxFix
Write A Post
Hire A Developer
Questions
DateTime? d=null; DateTime d2; bool success = DateTime.TryParse("some date text", out d2); if (success) d=d2;
(There might be more elegant solutions, but why don't you simply do something as above?)