SUB_DT_DT

Returns the difference between two date-and-time values as a duration.

Signature

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

The return type is TIME. Both inputs are DATE_AND_TIME.

Inputs

Name

Type

Description

IN1

DATE_AND_TIME

The minuend date-and-time.

IN2

DATE_AND_TIME

The subtrahend date-and-time.

Outputs

Name

Type

Description

Return value

TIME

IN1 minus IN2 as a duration.

Description

Returns the time difference IN1 minus IN2 as a TIME duration in milliseconds. The internal subtraction is in seconds, then converted to milliseconds.

Example

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

See Also

References