Documentation

DECOMPOSEDATE

Function name

DECOMPOSEDATE

ST call

PROGRAM DECOMPOSEDATE_DEMO
VAR
DT1: DT;
O1,Y:INT;
M,D,DOW:SINT;
END_VAR
O1 := DECOMPOSEDATE(T := DT1, YEAR => Y, MONTH => M, DAY => D, DAYOFWEEK => DOW);
END_PROGRAM

Description

Converts a DATETIME variable to individual date components as integer values.

Inputs

Input Type Description
T DT Input value

Outputs

Output Type Description
=> INT Output value, 1 means that the conversion has been executed successfully
YEAR INT number of years
MONTH SINT number of months
DAY SINT number of days
DAYOFWEEK SINT day of week (Monday 1...Sunday 7)

Application example