Is there an easy way within C# to check to see if a DateTime instance has been assigned a value or not?
do you mean like so:
DateTime datetime = new DateTime(); if (datetime == DateTime.MinValue) { //unassigned }
or you could use Nullable
DateTime? datetime = null; if (!datetime.HasValue) { //unassigned }
1.4m articles
1.4m replys
5 comments
57.0k users