SUB_DT_TIME¶
Subtracts a duration from a date-and-time value.
Signature¶
┌──────────┐
IN1 ─┤ │
│SUB_DT_TIME├─ OUT
IN2 ─┤ │
└──────────┘
FUNCTION SUB_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 |
|---|---|---|
|
|
The date-and-time to offset. |
|
|
The duration to subtract. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
IN1 with IN2 subtracted. |
Description¶
Returns a new DATE_AND_TIME offset from IN1 by subtracting the
duration IN2. The duration is converted from milliseconds to seconds.
Example¶
result := SUB_DT_TIME(DT#2000-01-01-01:00:00, T#1h);
See Also¶
ADD_DT_TIME — add duration to datetime
SUB_DT_DT — difference between two datetimes