ADD_TIME

Use the ADD_TIME script function to add two times. The script function returns the result of the addition, in the time format that you specify. The calculation takes the change from 23:59:59 to 00:00:00 into account.

Syntax

ADD_TIME ([Time Format;]Time1, [Time Format;]Time2 [,Output Format])

Parameters

  • ADD_TIME
    Adds two times

  • Time Format
    (Optional) Specify a format followed by a semicolon separator (;)
    More Information: Date, Time and Period Formats in Scripts

  • Time1Time2
    Times to add, in HHMMSS format
    Format: script literal or script variable

  • Output Format
    (Optional) time format for the time that the script function returns
    Format: AE name, script literal or script variable
    Default: HHMMSS

Examples

The following example adds two times without specifying a time format. The script prints the result (130000) in the activation report.

: SET &TIME# = ADD_TIME ("120000""010000" )
:
 PRINT &TIME#

The following example specifies time formats for one of the times and for the output. The script prints the result (04:59) in the activation report.

: SET &TIME# = ADD_TIME ("235959""HH;05""HH:MM" )
:
 PRINT &TIME#

The following example adds 71 seconds to 23:59:59. The script specifies the time formats for both times given, but not for the output. The script prints the result (000110) in the default format.

: SET &TIME# = ADD_TIME ("HH:MM:SS;23:59:59""SS;71" )
:
 PRINT &TIME#

The following example also adds 71 seconds to 23:59:59. The script specifies a format that only includes the seconds for the output. The script prints the result (70) in the activation report.

: SET &TIME# = ADD_TIME ("HHMMSS;235959""SS;71" , SS)
:
 PRINT &TIME#

See also: