Time 函数

返回 Date 子类型的变体,指示当前系统时间。

语法

Time

注释

以下示例使用 Time 函数返回当前系统时间:

示例 1

Dim MyTime
MyTime = Time

示例 2

Dim MyTime1, MyHour, MyMinute, MySecond
MyTime1 = Time
MyHour = Hour(MyTime1)     
MyMinute = Minute(MyTime1)  
MySecond = Second(MyTime1)  

'Output: Current Time
'Output: Hour from Current Time
'Output: Minute from Current Time
'Output: Second from Current Time