SECS Function

Purpose

Returns either the number of seconds corresponding to a specified date/time pattern string, or the number of seconds for today's date.

Syntax

SECS (d, p, w)

Parameters

d is a string expression that represents a date. If specified, d treats the input date as a character string representing the date/time specified in the pattern specified by p. If not specified, SECS uses the value returned by DATETIME().

The value for d must have computational type and should have character type. If not, the SECS function converts d to character.

p is a supported date/time pattern. If not specified, SECS uses the value YYYYMMDDHHMISS9999. Like the value for d, p must have computational type and should have character type. If not, the SECS function converts p to character.

w specifies an expression (such as 1976) that can be converted to an integer.

  • Any positive numeric value is treated as a year.
  • Negative or zero values are treated as an offset and subtracted from the current, system-supplied year.
  • If not specified, the value of w is the value specified in the -window compile-time option.

Description

The SECS function returns a FLOAT BINARY(53) value for is the number of seconds (Lilian format) corresponding to the date specified by d.

See the help topic Date/Time Built-in Functions for more information about Lilian format and supported date/time patterns.

Examples

See the example in the DAYS Function topic to see how SECS can be used.

Restrictions

None.