Home

Error using DateAndTime struct in VB Statements

I have the following code:
Dim targetDate As Date = New Date(2015, 1, 14)
Dim result as Long = DateAndTime.DateDiff(DateInterval.Day, Date.Now, targetDate)
result.Dump()
When I try to run it I get this:
'DateAndTime' is not declared. It may be inaccessible due to its protection level.
'DateInterval' is not declared. It may be inaccessible due to its protection level.

These objects are under the Microsoft.VisualBasic namespace, I assumed it would be imported by default. If thats not the case then what do I need to do to import the namespace (aside from creating a class with functions)?

Comments

Sign In or Register to comment.