可能重複:
How can I format a nullable DateTime with ToString()?日期時間的ToString(格式)
得到了問題的解析日期時間?以特定的格式。 Like:
DateTime t1 = ...;
string st1 = t1.ToString(format); //<-- works
DateTime? t1 = ...;
string st1 = t1.ToString(format); //Dont work.
Theres沒有對DateTime的重載方法?
http:// stack overflow.com/questions/1833054/how-can-i-format-a-nullable-datetime-with-tostring 我的不好。請關閉/刪除。 對不起 – VoonArt