How to get short date for Get short date for System Nullable datetime (datetime ?)
for ed 12/31/2013 12:00:00
--> only should return 12/31/2013
.
I don't see the ToShortDateString
available.
You need to use .Value
first (Since it's nullable).
var shortString = yourDate.Value.ToShortDateString();
But also check that yourDate
has a value:
if (yourDate.HasValue) {
var shortString = yourDate.Value.ToShortDateString();
}