DECOMPOSEDATE
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
Converts a DATETIME variable to individual date components as integer values.
Input | Type | Description |
T | DT | Input value |
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) |