The preferred way to make a date object in .NET is to use the DateTime(int, int, int) constructor:
DateTime dtA = new DateTime(2007, 8, 16)
Try to avoid using the legacy VB6 functions if possible - they reduce a programmers ability to read other .NET syntaxes and exist largely as mapping functions to allow old VB6 code to be pasted into VB.NET apps and have a small hope of working correctly (and a larger hope of being not-too-broken)
Legacy functions, for the most part, can be identified by: being functions in vb6, belonging to the Microsoft.VisualBasic namespace. They wrap the more modern, better formed .NET counterparts found throughout the framework
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.