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 |
|---|---|---|
|
|
The minuend date-and-time. |
|
|
The subtrahend date-and-time. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
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¶
ADD_DT_TIME — add duration to datetime
SUB_DT_TIME — subtract duration from datetime