You can try this:-
DateTime? dt = string.IsNullOrEmpty(date) ? (DateTime?)null : DateTime.Parse(date);
2.1m questions
2.1m answers
60 comments
57.0k users