Nullable DateTime formatting
Hello,
I have the following code
DateTime? dt = new DateTime();
dt = DateTime.Now;
string st = String.Empty;
st = dt.ToString("yyyy/MM/dd");
After compiling it gives the following error.
"Error 1 No overload for method 'ToString' takes '1' arguments"
How can I overcome this error. I want DateTime to be nullable. Any One for help.
|