ADD_TIMESTAMP

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

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

Tip: Use ADD_DAYS to add whole days to a date.

Syntax

ADD_TIMESTAMP (Timestamp,Time)

Parameters

  • ADD_TIMESTAMP
    Adds hours, minutes and second to a timestamp

  • Timestamp
    Timestamp that you want to add time to, in YYYY-MM-DD HH:MM:SS format
    Format: script literal or script variable

  • Time
    Amount of time to add to the timestamp, in HH:MM:SS format
    Format: script literal or script variable
    Allowed values: 0 to 99 for each of the values in the timestamp (HH, MM, and SS)

Return Code

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


Example

The following example adds 24 hours and one second to a timestamp, and prints the result (2019-01-01 00:00:01) in the activation report.

:SET &RET# = ADD_TIMESTAMP("2018-12-31 00:00:00", "24:00:01")
:
PRINT &RET#

See also: