SUB_TIMESTAMP

Use the SUB_TIMESTAMP script function to subtract time from a timestamp. The function lets you subtract up to 99 hours, minutes and seconds from the timestamp, so the result can be just over 4 days before the original timestamp.

Note: SUB_TIMESTAMP uses UTC for the calculation, and does not consider Daylight Time or Standard Time.

Tip: Use SUB_DAYS when you need to subtract days from a date.

Syntax

SUB_TIMESTAMP (Timestamp,Time)

Parameters

Return Code

The script function returns a timestamp in YYY-DD-MM HH:MM:SS format.


Example

The following example subtracts one second from the timestamp, and prints the (2018-12-31 23:59:59) in the activation report.

:SET &RET# = SUB_TIMESTAMP("2019-01-01 00:00:00", "00:00:01")
:
PRINT &RET#

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts