Manipulates a TIMESTAMP or returns the number of days between two TIMESTAMP values. For specific details, see the Remarks section below.
integer-expression The number of days to be added to the timestamp-expression. If the integer-expression is negative, the appropriate number of days is subtracted from timestamp-expression. If you supply an integer expression, the timestamp-expression must be explicitly cast as a TIME, DATE or TIMESTAMP. If timestamp-expression is a TIME value, the current date is assumed.
The result of the DAYS function depends on its arguments. The DAYS function ignores hours, minutes, and seconds in its arguments.
Syntax 1 If you pass a single timestamp-expression to the DAYS function, it will return the number of days between 0000-02-29 and timestamp-expression as an INTEGER.
0000-02-29 is not meant to imply an actual date; it is the default date used by the DAYS function.
Syntax 2 If you pass two TIMESTAMP values to the DAYS function, the function returns the integer number of days between them.
Syntax 3 If you pass a TIMESTAMP value and an integer to the DAYS function, the function returns the TIMESTAMP result of adding the integer number of days to the timestamp-expression argument.