SUB_DT_TIME - Subtracts an interval from a date and time value


Returns the result of an interval subtracted from a date and time.

Informal Syntax:

SUB_DT_TIME( In1, In2 )

Formal Syntax:

SUB_DT_TIME( In1:=expression, In2:=expression )


In1DATE_AND_TIMEThe date and time value.
In2TIMEThe interval to subtract from the date and time value.

In2 can be any interval value, positive or negative.

Return value

The function SUB_DT_TIME returns a DATE_AND_TIME value, the result of In1 - In2.


ExampleReturn Value
SUB_DT_TIME( DT#2013-01-07-16:48:00.000, T#4h30m)DT#2013-01-07-12:18:00.000

Standards Compliance

Table 30.8b - IEC 61131-3 Second Edition.

Table 35.8b - IEC 61131-3 Third Edition.

Further Information

Date and Time Functions

For other date and time functions.


For the meaning of terms used in Fernhill SCADA.