VB.Net - Date


Date Data Type

The Date is an alias only available in VB.Net
For backwards compatibility you can still use the Date type as a synonym for the System.DateTime type.
The Now property returns the system date and time

Dim dtDate As Date 
dtDate = New Date().Now

The Today property returns the system date only

Dim dtDate As Date 
dtDate = New Date().Today

You can also initialise a date object by passing in the year, month and day values.

Dim dtDate As Date 
dtDate = New Date(2004, 5, 12)


Date variables are initialised to 1/1/0001 12:00:00am




© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext