Answers for "how to convert nullable datetime toshortdatestring"

0

how to convert nullable datetime toshortdatestring

DateTime? dt = (DateTime?)DateTime.Now;
string dateToday = string.Format("{0:d}", dt);
Posted by: Guest on July-17-2020
0

how to convert nullable datetime toshortdatestring

if (yourDate.HasValue) {
   var shortString = yourDate.Value.ToShortDateString();
}
Posted by: Guest on July-17-2020

Code answers related to "how to convert nullable datetime toshortdatestring"

Browse Popular Code Answers by Language