Table of contents

Time 语句Time Statement

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

设置系统时间。Sets the system time.


时间 =时间Time =time

在要求的_时间_参数是任何数值表达式字符串表达式或任何组合,表示时间。备注时间_是一个字符串,如果时间会尝试将其转换为使用时间分隔符为系统指定的时间。如果不能转换为有效的时间,就会出错。The required _timeargument is anynumeric expression, string expression, or any combination, that can represent a time. Remarks If time is a string, Time attempts to convert it to a time using the time separators you specified for your system. If it can't be converted to a valid time, an error occurs.


此示例使用Time语句将计算机的系统时间设置为用户定义的时间。This example uses the Time statement to set the computer system time to a user-defined time.

Dim MyTime 
MyTime = #4:35:17 PM# ' Assign a time. 
Time= MyTime ' Set system time to MyTime. 
© 2018 Microsoft