how to check datetime has unassigned or default value?
beginer
1328
Points
43
Posts
|
Is there any way apart from following?
|
Answers
Priya
936
Points
28
Posts
|
If you have a DateTime object, then the default value is DateTime.MinValue, and hence you have to check it like this:
If the DateTime object is nullable, then here is a different story:
Posted On:
06-Jul-2021 05:33
Thanks. - beginer 19-Jul-2021 21:21
|
Smith
2568
Points
74
Posts
|
We can create extension method to check empty or unassigned datetime object as
And can be used as:
Posted On:
07-Jul-2021 00:18
Thanks. - beginer 19-Jul-2021 21:21
|