SPLIT_DATE - Extracts the year, month and date from a DATE value

Help Contents

Introduction

Extracts the following fields from a DATE value:

Syntax

Informal Syntax:

SPLIT_DATE( IN, YEAR, MONTH, DATE )

Formal Syntax:

SPLIT_DATE( IN:=expression,
  YEAR=>variable, MONTH=>variable, DATE=>variable )

Parameters

ParameterTypeDescription
INDATEThe date value to split into the year, month and date.
YEARREF_TO INTThe year value extracted from the input value.
MONTHREF_TO INTThe month value extracted from the input value.
DATEREF_TO INTThe date value extracted from the input value.

Return Value

None.

Examples

Example of an informal call:

VAR
    Year, Month, Date : INT;
END_VAR

SPLIT_DATE(
    DATE#2013-01-10-21:50:00.000,
    Year, Month, Date )

The variable values after the SPLIT_DATE function call will be:

VariableValue
YearINT#2013
MonthINT#1
DateINT#10

Standards Compliance

Table 36.5 - 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.