Fr开发者_如何学编程om 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?
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.
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
精彩评论