Second (function)

Syntax

Second(time)

Description

Returns the second of the day encoded in the specified time parameter.

Comments

The value returned is an Integer between 0 and 59 inclusive.

The time parameter is any expression that converts to a Date.

Example

This example fires an event every 10 seconds based on the system clock.

Sub Main()
  trigger = 10
  Do
    xs% = Second(Now)
    If (xs% Mod trigger = 0) Then
      Beep
      End  'Remove this line to trigger the loop continuously.
      Sleep 1000
    End If
    DoEvents
  Loop
End Sub

See Also

Day (function); Minute (function); Month (function); Year (function); Hour (function); Weekday (function); DatePart (function).

More information

S