SQL - Scalar functions - MINUTES_BETWEEN
The MINUTES_BETWEEN function returns the number of full minutes between the specified arguments.
The schema is SYSIBM.
If there is less than a full minute between expression1 and expression2, the result is zero. If expression1 is later than expression2, the result is positive. If expression1 is earlier than expression2, the result is negative. If expression1 or expression2 contains time information, this information is also used to determine the number of full minutes. If expression1 or expression2 does not contain time information, a time of midnight (00.00.00) is used for the argument that is missing time information.
The result of the function is a BIGINT. If either argument can be null, the resultcan be null. If either argument is null, the result is the null value.
SET :NUM_MINUTES = MINUTES_BETWEEN(TIMESTAMP '2012-03-01-01.07.00', TIMESTAMP '2012-02-28-00.00.00')
SET :NUM_MINUTES = MINUTES_BETWEEN(TIMESTAMP '2013-09-11-23.59.59', TIMESTAMP '2013-09-01-00.00.00')
SET :NUM_MINUTES = MINUTES_BETWEEN(TIMESTAMP '2013-09-01-00.00.00', TIMESTAMP '2013-09-11-23.59.59')