Creating


Dates

You can initialise a date in several ways:

Dim dtDateTime As System.DateTime 
dtDateTime = New System.DateTime(2004, 5, 12)

You can also include an exact hour, minute and second

Dim dtDateTime As System.DateTime 
dtDateTime = New System.DateTime(2004, 5, 12, 10, 20, 30)

If you want to initialise to just todays date (with no time) you can use the Today property

dtDateTime = System.DateTime.Today 


System.DateTime.Month - returns 1 for January
System.DateTime.Year - returns the current year (eg 2011)



Times





© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

PrevNext