返回一个 Variant (Date) 值,指示当前的系统时间。
语法
Time
备注
若要设置系统时间,请使用 Time 语句。
查询示例
表达式 | 结果 |
---|---|
SELECT Time () AS Expr1 FROM ProductSales GROUP BY Time () ; |
返回系统时间格式的当前系统"时间"并显示在 Expr1 列中。 |
SELECT Time () AS CurrentTime FROM ProductSales GROUP BY Time () ; |
返回系统时间格式的当前系统"时间",并显示在 CurrentTime 列中。 |
VBA 示例
注意: 以下示例演示了在 VBA Visual Basic for Applications (模块) 函数。 有关使用 VBA 的信息,请在"搜索"旁边的下拉列表中选择"开发人员参考",在搜索框中输入一个或多个术语。
此示例使用 Time 函数返回当前系统时间。
Dim MyTime
MyTime = Time ' Return current system time.