52

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?

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
poke
  • 2,934
  • 5
  • 27
  • 37

2 Answers2

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
9

C# has no Date type, but DateTimes 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