EXTRACT_DT_YEAR
Function Name |
EXTRACT_DT_YEAR |
---|---|
Description |
Converts a Date and Time input into an integer output for the year. |
Arguments |
Input 1 {DATE_AND_TIME} |
Returns |
Output {INT} The output is the year part of the Date and Time input. |
Example:
Function Block Diagram - EXTRACT_DT_YEAR:
An EXTRACT_DT_YEAR function has an input of NOW. This sets the input to be the current date and time. The EXTRACT_DT_YEAR function returns the year part of the date in the Date and Time input as its output. So, if the date and time value of the input was 2006-03-21-10:25:00.000, the EXTRACT_DT_YEAR function would return 2006 (the year part of the Date and Time input).
ST Program - EXTRACT_DT_YEAR:
The syntax for an EXTRACT_DT_YEAR function in an ST Program is:
- Output := EXTRACT_DT_YEAR (Input 1)
Where Output is an integer value and Input 1 is a Date and Time value.