Second()

Syntax

Second(SerialNumber)

Remarks

Returns an integer between 0 (zero) and 59, inclusive, corresponding to the seconds component of SerialNumber, a decimal representation of the date, time, or both. For information about serial numbers, see DateSerial().

Example

This example produces a beep five seconds after the macro is started. Note that Second(Now()) returns the seconds component of the current time according to your computer's built-in clock.


n = Second(Now())
beepTime = n + 5
If beepTime > 59 Then beepTime = beepTime - 60
While Second(Now()) <> beepTime
Wend
Beep

See Also

DateSerial(), Day(), Hour(), Minute(), Month(), Now(), Today(), Weekday(), Year()