How can I convert the nullable DateTime dt2 to a formatted string?
DateTime dt = DateTime.Now; Console.WriteLine(dt.ToString(\"yyyy-MM-dd hh
You can use dt2.Value.ToString("format"), but of course that requires that dt2 != null, and that negates th use of a nullable type in the first place.
dt2.Value.ToString("format")
There are several solutions here, but the big question is: How do you want to format a null date?
null