SUB_TOD_TOD

Returns the difference between two time-of-day values as a duration.

Signature

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

The return type is TIME. Both inputs are TIME_OF_DAY.

Inputs

Name

Type

Description

IN1

TIME_OF_DAY

The minuend time-of-day.

IN2

TIME_OF_DAY

The subtrahend time-of-day.

Outputs

Name

Type

Description

Return value

TIME

IN1 minus IN2 as a duration.

Description

Returns the difference IN1 minus IN2 as a TIME duration. Both inputs and the result are in milliseconds.

Example

result := SUB_TOD_TOD(TOD#14:00:00, TOD#12:00:00);
(* result = T#2h *)

See Also

References