DB2 Scalar functions - ADD_HOURS
The ADD_HOURS function returns a timestamp value that represents the first argument plus a specified number of hours.
The schema is SYSIBM.
The result of the function is a timestamp with the same precision as expression, if expression is a timestamp. Otherwise, the result is a TIMESTAMP(12). If any argument can be null, the result can be null; if any argument is null, the result is the null value.
SET :ADD_HOUR = ADD_HOURS(CURRENT TIMESTAMP, 1)
SET :ADD_HOUR = ADD_HOURS(:TIMESTAMP,3)
SET :TIMESTAMPHV = TIMESTAMP '2008-2-28-22.58.59' + 4 HOURS SET :TIMESTAMPHV = ADD_HOURS( TIMESTAMP '2008-2-28-22.58.59', 4)
SET :TIMESTAMPHV = TIMESTAMP '2008-2-28-22.58.59' + 28 HOURS SET :TIMESTAMPHV = ADD_HOURS(TIMESTAMP '2008-2-28-22.58.59', 28)
SET :ADD_HOUR = ADD_HOURS(:TIMESTAMP,-3)