The schema is SYSFUN.
Returns an estimated number of intervals of the type defined by the first argument, based on the difference between two timestamps.
The second argument is the result of subtracting two timestamps and converting the result to CHAR(22). The string value must not have more than 6 digits to the right of a decimal point. In a Unicode database, if a supplied argument is a graphic string, it is first converted to a character string before the function is executed.
The result of the function is INTEGER. The result can be null; if the argument is null, the result is the null value.
These assumptions are used when converting the information in the second argument, which is a timestamp duration, to the interval type specified in the first argument. The returned estimate may vary by a number of days. For example, if the number of days (interval 16) is requested for the difference between '1997-03-01-00.00.00' and '1997-02-01-00.00.00', the result is 30. This is because the difference between the timestamps is 1 month, and the assumption of 30 days in a month applies.
Example:
TIMESTAMPDIFF(4,CHAR(TIMESTAMP('2001-09-29-11.25.42.483219') -
TIMESTAMP('2001-09-26-12.07.58.065497')))