second(X)

Returns the seconds portion of a time-related value.

Syntax

second(X)

Input

Argument Type Description
X any numeric type A scalar value or the name of a column containing time-related values
Valid values can be of the form:
  • time
  • date+time

For more information, see Dates and time.

Return Value

Returns the integer value corresponding to the seconds portion of the time-related value given as input.

If the input values are not in one of the supported formats listed above, the function returns an erroneous or illogical output.

Example

The following example gets the login date and time using the logindatetime(X) function and then uses the second(X) function to get the seconds portion of it.

<base table="default.lonely" label="Example: second(X)"/>
<willbe name="login_date_time" value="logindatetime(-5)" 
 label="Login Date/Time" format="type:datehms24"/>
<willbe name="login_second" value="second(login_date_time)" 
 label="Login Second"/>
<colord cols="login_date_time,login_second"/>