Convert String to Nullable DateTime [duplicate] May 26, 2023 by Tarik You can try this:- DateTime? dt = string.IsNullOrEmpty(date) ? (DateTime?)null : DateTime.Parse(date);