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 |
|---|---|---|
|
|
The minuend time-of-day. |
|
|
The subtrahend time-of-day. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
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¶
ADD_TOD_TIME — add duration to time-of-day
SUB_TOD_TIME — subtract duration from time-of-day