ADD_DT_TIME

Adds a duration to a date-and-time value.

Signature

     ┌──────────┐
IN1 ─┤          │
     │ADD_DT_TIME├─ OUT
IN2 ─┤          │
     └──────────┘
FUNCTION ADD_DT_TIME : DATE_AND_TIME
  VAR_INPUT
    IN1 : DATE_AND_TIME;
    IN2 : TIME;
  END_VAR
END_FUNCTION

The return type is DATE_AND_TIME. IN1 is DATE_AND_TIME and IN2 is TIME.

Inputs

Name

Type

Description

IN1

DATE_AND_TIME

The date-and-time to offset.

IN2

TIME

The duration to add.

Outputs

Name

Type

Description

Return value

DATE_AND_TIME

IN1 offset by IN2.

Description

Returns a new DATE_AND_TIME offset from IN1 by the duration IN2. The duration is converted from milliseconds to seconds before being added.

Example

result := ADD_DT_TIME(DT#2000-01-01-00:00:00, T#1h);

See Also

References