檢查 date 是否為 null | c#

Snippet

1
2
3
4
 if (!datetime.HasValue)
 {
     //unassigned
 }

參考資料

[Checking to see if a DateTime variable has had a value assigned

comments powered by Disqus