SUB_TIME - Subtract two interval values

Help Contents


Returns the difference of two interval values.

Informal Syntax:

SUB_TIME( In1, In2 )

Formal Syntax:

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


In1TIMEThe first interval value.
In2TIMEThe second interval value.

In1 and In2 can be any interval values, positive or negative.

Return Value

The function SUB_TIME returns the result of In1 - In2.

The overloaded function SUB can also be used to subtract two interval values.


ExampleReturn Value
SUB_TIME( T#5s, T#10s )TIME#-5s
SUB_TIME( T#4h, T#-10h )TIME#14h

Standards Compliance

Table 30.4b - IEC 61131-3 Second Edition.

Table 35.4b - 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.