The seconds_between() function determines the truncated number of full seconds between two timestamps.
int8 = seconds_between(timestamp t1, timestamp t2);
The t1 value specifies the beginning timestamp.
The t2 value specifies the ending timestamp.
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.