SECOND Function

Returns the second from a SAS time or datetime value.

Category: Date and Time

Syntax

SECOND(time | datetime )

Required Arguments

time

is a numeric constant, variable, or expression with a value that represents a SAS time value.

datetime

is a numeric constant, variable, or expression with a value that represents a SAS datetime value.

Details

The SECOND function produces a numeric value that represents a specific second of the minute. The result can be any number that is >= 0 and < 60.

Example

The following SAS statements produce these results.
SAS Statement
Result
time='3:19:24't;
s=second(time);
put s;
24
time='6:25:65't;
s=second(time);
put s;
5
time='3:19:60't;
s=second(time);
put s;
0

See Also