您应该检查 default(DateTime) 其值与 DateTime.MinValue 相同,但正式上来说,default(T) 更好。它更易读,并且更符合 default(int) 的规范,后者是 0,与 int.MinValue 相差很大。 在泛型类中,default(T) 对于 DateTime 与所有内置值类型一样适用。
Nullable<DateTime>
。尝试使用DateTime?
作为类型,它允许将null
作为值。参考链接:http://msdn.microsoft.com/en-us/library/1t3y8s4s%28v=vs.100%29.aspx - Jesse Webb