From what I can tell Date and DateTime have the same functionality. Is there a reason why I would want to use one instead of the other?
Asked
Active
Viewed 2.9k times
52
-
1I've retagged to VB.NET because VB.NET does have a Date type (actually an alias to DateTime which would explain the question). I hope my assumption is correct. – R. Martinho Fernandes Apr 11 '11 at 18:36
-
1@Martinho: Your assumption is correct – poke Apr 11 '11 at 18:42
-
4Since its a wash, I'm planning to use DateTime because it makes it more explicit that it contains a time component. – poke Apr 12 '11 at 01:58
2 Answers
65
In VB.NET Date
is an alias to System.DateTime
, so yes, they're the same thing. You can see all the aliases in this chart on MSDN.

R. Martinho Fernandes
- 228,013
- 71
- 433
- 510
-
1
-
1and "their supporting common language runtime types". C# says the same thing but includes the word alias. http://msdn.microsoft.com/en-us/library/ya5y69ds.aspx – Chris Haas Apr 11 '11 at 19:31
-
1So as DateTime is specified in the CLR, this is the better one to use then? – David Wilson Apr 24 '16 at 00:52
9
C# has no Date
type, but DateTime
s do have a Date
property which returns a DateTime
with all of the time-related fields cleared out.
Specifically it returns:
A new object with the same date as this instance, and the time value set to 12:00:00 midnight (00:00:00).
VB.NET does have a Date
type but it is equivalent to a CLR DateTime

Daniel DiPaolo
- 55,313
- 14
- 116
- 115