Last post Dec 12, 2008 07:22 PM by David Anton
Dec 12, 2008 05:14 PM|geosync|LINK
There must be a better way to work with a variable of type DateTime ...
If I declare a DateTime variable
Dim DT as DateTime
and don't initialize it, it's value is
How do I check if a DateTime var is intialized? By checking for this value? Really?
Dec 12, 2008 05:50 PM|SGWellens|LINK
You can check for this:
Dec 12, 2008 07:22 PM|David Anton|LINK
In VB, you have two simple solutions:
1. Just test against 'Nothing', which can be used with both reference and value types (DateTime is a value type). (In C#, you can't use 'null' with value types).
2. Use a nullable DateTime:
Dim DT As DateTime? 'VB9
Dim DT As Nullable(Of DateTime) 'pre-VB9