F_AGEINSECONDS

<< F_AGEINMINUTESN | IBExpert UDF Functions | F_AGEINSECONDSN >>

F_AGEINSECONDS

 

substitutable with DATEDIFF

  • function from adhoc
  • Compatible with UTF-8
  • Input TIMESTAMP (older) date optionally time 1, TIMESTAMP (newer) date optionally time 2
  • Output INTEGER difference in (integer) seconds between timestamp 1 and timestamp 2

if you want a negative number if the first date is newer than the second date

Example

 SELECT 20 AS ISCORRECT, F_AGEINSECONDS('01.12.2018 15:01:01','01.12.2018 15:01:21') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINSECONDS
 ============ ==============
           20             20

Example

 SELECT -3580 AS ISCORRECT, F_AGEINSECONDS('01.12.2018 15:01:01','01.12.2018 14:01:21') FROM RDB$DATABASE;

Expected results:

    ISCORRECT F_AGEINSECONDS
 ============ ==============
        -3580          -3580

back to top of page
<< F_AGEINMINUTESN | IBExpert UDF Functions | F_AGEINSECONDSN >>