vb.net 日期而不是日期时间?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5625795/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Date instead of DateTime?
提问by poke
回答by R. Martinho Fernandes
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 charton MSDN.
在 VB.NET 中Date
是 的别名System.DateTime
,所以是的,它们是一样的。您可以在 MSDN 上查看此图表中的所有别名。
回答by Daniel DiPaolo
C# has no Date
type, but DateTime
s do have a Date
propertywhich returns a DateTime
with all of the time-related fields cleared out.
C# 没有Date
类型,但DateTime
s 确实有一个Date
属性,它返回一个DateTime
清除所有与时间相关的字段。
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).
与此实例具有相同日期的新对象,并且时间值设置为午夜 12:00:00 (00:00:00)。
VB.NET does have a Date
type but it is equivalent to a CLR DateTime
VB.NET 确实有一个Date
类型,但它相当于一个 CLRDateTime