SUB_DATE_DATE - Subtracts one date value from another

Introduction

Returns the difference between two date values as an interval.

Informal Syntax:

SUB_DATE_DATE( In1, In2 )

Formal Syntax:

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

Parameters

ParameterTypeDescription
In1DATEThe first date value.
In2DATEThe second date value to subtract from the first.

Return value

The function SUB_DATE_DATE returns an interval, the result of In1 - In2.

If In2 is greater than In1, the returned interval will be negative.

Examples

ExampleReturn Value
SUB_DATE_DATE( D#2013-01-07, D#2013-01-01 )T#6d
SUB_DATE_DATE( D#2013-01-07, D#2013-01-08 )T#-1d
SUB_DATE_DATE( In1:=D#2013-01-07, In2:=D#2013-01-07 )T#0

Standards Compliance

Table 30.5b - IEC 61131-3 Second Edition.

Table 35.5b - IEC 61131-3 Third Edition.

Further Information

Date and Time Functions

For other date and time functions.

Glossary

For the meaning of terms used in Fernhill SCADA.