Date and Time functions

Help Contents

Introduction

Date and Time functions perform calculations on these date types:

• TIME
• DATE
• TIME_OF_DAY
• DATE_AND_TIME

These Date and Time functions are supported:

Function Supported In Explanation
ADD_DT_TIME 3.0 Adds an interval to a date and time value.
ADD_TOD_TIME 3.0 Adds an interval to a time of day value.
CONCAT_DATE_TOD 3.58 Adds a time of day value to a date.
CONCAT_DATE 3.58 Constructs a DATE value from: Year, Month and Date values.
CONCAT_DT 3.58 Constructs a DATE_AND_TIME value from: Year, Month, Date, Hour, Minute, Second and Millisecond values.
CONCAT_TOD 3.58 Constructs a TIME_OF_DAY value from: Hour, Minute, Second and Millisecond values.
DAY_OF_WEEK 3.58 Returns the day of week of a DATE value.
DIVTIME 3.0 Divides an interval by a numeric value.
MULTIME 3.0 Multiplies an interval by a numeric value.
SPLIT_DATE 3.58 Extracts the fields from a DATE value.
SPLIT_DT 3.58 Extracts the fields from a DATE_AND_TIME value.
SPLIT_TOD 3.58 Extracts the fields from a TIME_OF_DAY value.
SUB_DATE_DATE 3.0 Subtracts two date values.
SUB_DT_DT 3.0 Subtracts two date and time values.
SUB_DT_TIME 3.0 Subtracts an interval from a date and time value.
SUB_TOD_TOD 3.0 Subtracts two time of day values.
SUB_TOD_TIME 3.0 Subtracts an interval from a time of day value.
SUB_TIME 3.0 Subtracts two interval values.

Standards Compliance

IEC 61131-3 Second Edition: Table 30.

IEC 61131-3 Third Edition: Table 35 & 36.

Further Information

Duration Literals

To learn about literals to represent a duration in time.

Date and Time Literals

To learn about literals to represent a date, a time of day, or date and time.

Arithmetic Functions and Operators

To learn about arithmetic operations on integer and real values.

SysGetDateAndTime()

To learn about a function that returns the current date and time.

SysGetDate()

To learn about a function that returns the current date.

SysGetTimeOfDay()

To learn about a function that returns the current time of day.

Common Elements

To learn about other common language elements.

Glossary

For the meaning of terms used in Fernhill SCADA.