IBM PureData System for Analytics, Version 7.1

The seconds_between() function

The seconds_between() function determines the truncated number of full seconds between two timestamps.

Description

The seconds_between() function has the following syntax:
int8 = seconds_between(timestamp t1, timestamp t2);

The t1 value specifies the beginning timestamp.

The t2 value specifies the ending timestamp.

Returns

Returns the truncated number of full seconds between t1 and t2. For example:
select seconds_between('1996-02-27 06:12:33','1996-02-27 06:55:22');
 SECONDS_BETWEEN
-----------------
            2569
(1 row)

The seconds_between() function ignores leap seconds. A leap second is an extra second that is added at the direction of the International Earth Rotation and Reference System Service (IERS) as needed to adjust atomic time with Earth's rotation. The IERS added a leap second at 23:59:60 UTC on June 30, 2012.



Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28