ADD_SECONDS

Purpose

This function adds a specified number of seconds to a timestamp.

Syntax

add_seconds::=

Add Seconds

Usage notes

  • Up to nine digits after the decimal point - representing a difference in nanoseconds - can be processed, but the value will be truncated to the fractional seconds precision of the first argument.

  • For data type TIMESTAMP WITH LOCAL TIME ZONE this function is calculated internally within UTC before the result is transformed to the session time zone.

Example

SELECT ADD_SECONDS(TIMESTAMP '2000-01-01 00:00:00',-1) AS1,
       ADD_SECONDS(TIMESTAMP '2000-01-01 00:00:00',+1.234) AS2;
Result
AS1 AS2
1999-12-31 23:59:59.000000 2000-01-01 00:00:01.234000