Second 函数Second function

返回某“变量”**** (“整数”****)指定 0 到 59 之间的整数(其中包含 0、59 这两个数)用于代表一分钟内的秒数。Returns a Variant (Integer) specifying a whole number between 0 and 59, inclusive, representing the second of the minute.

语法Syntax

(time)Second(time)

必需的_time_ 参数是任何可表示时间的变量数值表达式字符串表达式或任何组合。The required time argument is any Variant, numeric expression, string expression, or any combination, that can represent a time. 如果_time_包含null, 则返回nullIf time contains Null, Null is returned.

示例Example

This example uses the Second function to obtain the second of the minute from a specified time.This example uses the Second function to obtain the second of the minute from a specified time. 在开发环境中, 使用代码的区域设置以短时间格式显示时间文本。In the development environment, the time literal is displayed in short time format by using the locale settings of your code.

Dim MyTime, MySecond
MyTime = #4:35:17 PM#    ' Assign a time.
MySecond = Second(MyTime)    ' MySecond contains 17.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.