F_SECONDSBETWEEN

<< F_INDMINUTESBETWEENTHRIB | IBExpert UDF Functions | IF_DLST: Daylight saving time >>

F_SECONDSBETWEEN

 
  • compatibility to GrUDF
  • 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

Example

 select 180 as ISCORRECT, F_SECONDSBETWEEN('01.10.2018 15:01:03', '01.10.2018 15:04:03')
 from RDB$DATABASE
 union
 select 182 as ISCORRECT, F_SECONDSBETWEEN('01.10.2018 15:04:03', '01.10.2018 15:01:01')
 from RDB$DATABASE
 union
 select null as ISCORRECT, F_SECONDSBETWEEN(null, null)
 from RDB$DATABASE;

Expected results:

    ISCORRECT
 ============ ============
       <null>       <null>
          180          180
          182          182

back to top of page
<< F_INDMINUTESBETWEENTHRIB | IBExpert UDF Functions | IF_DLST: Daylight saving time >>