You are here: Core Reference > Coding > Logic > ADD_DT_TIME

ADD_DT_TIME

Function Name

ADD_DT_TIME

Description

Adds a date and time input to a time interval input and outputs the result.

Arguments

Input 1 {DATE_AND_TIME}

Input 2 {TIME}

For more information on the data types for the inputs and outputs, see Data Type Hierarchy.

Returns

Output {DATE_AND_TIME}

Example:

Function Block Diagram - ADD_DT_TIME:

An ADD_DT_TIME function has two inputs:

  • Input 1 is a date and time value (in this case, a NOW function which provides the current date and time)
  • Input 2 is a constant with a time value of T#10m (10 minutes).

NOTE: You can use the UTC_TO_LOCAL function to convert the NOW input from UTC time to Local time.

The ADD_DT_TIME function adds the time interval defined by Input 2 (10 minutes) to the NOW time, and outputs the result. So, if the NOW time is 2006-03-21-09:27.31.546, the ADD_DT_TIME function adds 10 minutes to that time and outputs 2006-03-21-09:37.31.546.

ST Program - ADD_DT_TIME:

The syntax for an ADD_DT_TIME function in an ST Program is:

Output := ADD_DT_TIME (Input 1, Input 2)


Where Output, Input 1 and Input 2 are defined as variables earlier in the ST program. Each input is separated by a comma. Output and Input 1 are Date and Time values and Input 2 is a Time value (it defines an interval).

Further Information

Time Zones: see Time Zone Support in ClearSCADA in the ClearSCADA Guide to Core Configuration.


ClearSCADA 2015 R2