VB 的时间

一、time

返回一个指明当前系统时间的 Variant (Date)。 17:54:20

二、timer

返回一个 Single,代表从午夜开始到现在经过的秒数。

Start = Timer ' 设置开始暂停的时刻。
Do While Timer < Start + PauseTime
DoEvents ' 将控制让给其他程序。
Loop

使用上面的代码可以实现等待 pausetime  ,单位s

三、date函数

返回日期,2020/5/23 星期六

四、format

使用format 函数可以对日期的函数进行限定。


MyStr = Format(MyTime, "h:m:s") '
返回 "17:4:23"

MyStr = Format(MyTime, "hh:mm:ss AMPM") ' 返回 "05:04:23 PM"

MyStr = Format(MyDate, "dddd, mmm d yyyy") ' 返回 "Wednesday, Jan 27 1993"

原文地址:https://www.cnblogs.com/Daluo20200515/p/12943746.html