Partager via


SEC( ) Function

Returns the seconds portion from a DateTime expression.

SEC(tExpression)

Parameters

  • tExpression
    Specifies the DateTime expression from which SEC( ) returns the second. If tExpression contains only a date and not a time, Visual FoxPro adds a default time of 12:00:00 AM (if SET HOURS is 12) or 00:00:00 (if SET HOURS is 24) to tExpression to produce a valid DateTime value.

Return Value

Numeric

Example

The following example displays the second portion of the current time and the second portion of a specific time.

CLEAR
? SEC(DATETIME( ))
? SEC({^2004-02-16 10:42:16AM})  && Displays 16

See Also

Reference

DATETIME( ) Function

HOUR( ) Function

MINUTE( ) Function

SET SECONDS Command

Other Resources

Functions