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.

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

Syntax

ADD_TIMESTAMP (Timestamp,Time)

Parameters

Parameter Description Format Allowed Values
Timestamp Specifies the timestamp that you want to add time to, in YYYY-MM-DD HH:MM:SS format. Script literal or script variable n.a.
Time Defines the amount of time to add to the timestamp, in HH:MM:SS format. Script literal or script variable
  • 0 to 99 for each of the values in the timestamp (HH, MM, and SS)

Important Considerations

Key considerations include:

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

Return Codes

The ADD_TIMESTAMP function returns a timestamp in YYYY-DD-MM HH:MM:SS format.

Examples

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: