F_ADDSECOND

<< F_ADDMINUTE | IBExpert UDF Functions | F_INCDATE >>

F_ADDSECOND

 

substitutable with DATEADD

  • function from adhoc
  • Compatible with UTF-8
  • Input TIMESTAMP date optionally time, INTEGER seconds to add
  • Output TIMESTAMP adds seconds to timestamp

If parameter 2 is negative, seconds to subtract.

Example

 select cast('01.10.2018 15:03:04' as timestamp) as ISCORRECT, F_ADDSECOND('01.10.2018 15:03:01', 3)
 from RDB$DATABASE
 union
 select cast('01.10.2018 15:02:58' as timestamp) as ISCORRECT, F_ADDSECOND('01.10.2018 15:03:01', -3)
 from RDB$DATABASE
 union
 select null as ISCORRECT, F_ADDSECOND(null, null)
 from RDB$DATABASE;

Expected results:

                 ISCORRECT
 ========================= =========================
                    <null>                    <null>
 2018-10-01 15:02:58.0000  2018-10-01 15:02:58.0000
 2018-10-01 15:03:04.0000  2018-10-01 15:03:04.0000

back to top of page
<< F_ADDMINUTE | IBExpert UDF Functions | F_INCDATE >>