Skip to main content
Previous sectionNext section

Second

Returns a whole number between 0 and 59, inclusive, representing the second of the minute.

Synopsis

Second(time)

Arguments

The time argument is any expression that can represent a time. This includes a time value such as “12:30” or “1:27:55”, a time/date value such as “11/12/1999 12:33:00”, or a date value such as “11/12/1999”. If only a date is specified, the time defaults to 00:00:00. Fractional seconds are permitted, but ignored; they are truncated, not rounded.

Examples

The following example uses the Second function to obtain the second from the current time:

Dim MyTime, MySec
MyTime = Now
MySec = Second(MyTime)
Println MySec
Copy code to clipboard

The following example returns a second value of 59:

Dim MySec
MySec = Second("13:59:59.999")
Println MySec
Copy code to clipboard

See Also