- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
VB.Net - 日期和时间
VB.Net - ⽇期和时间
你写的⼤部分软件都需要实现某种形式的⽇期功能,返回当前⽇期和时间。⽇期是⽇
⽣活的⼀部分,使⽤它能让⼯作变得轻松,不需要太多思考。 VB .Net还提供了强⼤
的⽇期算术⼯具,使操作⽇期变得容易。
⽇期数据类型包含⽇期值,时间值或⽇期和时间值。 Date的默认值为000 1年1⽉1 ⽇的
0:00:00 (午夜)。等效的.NET数据类型为System .DateTime 。
DateTime 结构表⽰即时时间,通 表⽰为⽇期和时间的⼀天
Declaration
SerializableAttribute _
Public Structure DateTime _
Implements IComparable, IFormattable, IConvertible, ISeria
IComparable( f DateTime), IEquatable( f DateTime)
您还可以从DateAndTime类获取当前⽇期和时间。
DateAndTime模块包含⽇期和时间操作中使⽤的过程和属性。
Declaration
StandardModuleAttribute _
Public NotInheritable Class DateAndTime
注意:
DateTime结构和DateAndTime模块都包含诸如Now和Today之类的属性,因此初学者
经 会感到困惑。 DateAndTime类属于Microsoft .VisualBasic命名空间,DateTime结
构属于System命名空间。
因此,使⽤以后的将帮助你移植你的代码到另⼀个.Net语⾔,如C #。 但是,
DateAndTime类模块包含Visual Basic 中所有可⽤的旧⽇期函数。
DateTime结构的属性和⽅法
下表列出了⼀些DateTime结构的 ⽤属性 :
S.N 属性 描述
1 Date Gets the date component of this instance .
获取此实例的⽇期组件。
Gets the day of the month represented by this instance .
2 Day 获取此实例所代表的⽉份中的某⼀天。
Gets the day of the week represented by this instance .
3 DayOfWeek 获取此实例表⽰的星期⼏。
Gets the day of the year represented by this instance .
4 DayOfYear 获取此实例表⽰的⼀年中的某⼀天。
5 Hour Gets the hour component of the date represented by this instance .
获取此实例表⽰的⽇期的⼩时组件。
Gets a value that indicates whether the time represented by this instance
6 Kind is based on local time , Coordinated Universal Time (UTC), or neither .G
获取⼀个值,该值指⽰此实例表⽰的时间是基于本地时间,协调世
界时间 (UTC )还是两者都不是。
7 Millisecond Gets the milliseconds component of the date represented by this instance .
获取此实例表⽰的⽇期的毫秒组件。
8 Minute Gets the minute component of the date represented by this instance .
获取此实例表⽰的⽇期的分钟分量。
9 Mont Gets the month component of
文档评论(0)