DATE into STRING
DATE_TO_STRING converts a value of the data type DATE into a value of the data type STRING[10].
The range for the input date is from D#2001-01-01 to D#2099-12-31.
Input
Output
All character spaces in the result string will be filled.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
DATE_value: DATE:=D#2011-12-24;
STRING_value: STRING[10]:='';
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_VARIN,,DATE_value,15,1,17,3,);
B(B_VAROUT,,STRING_value,27,1,29,3,);
B(B_F,DATE_TO_STRING!,Instance,17,1,27,3,,?D?C);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
STRING_value := DATE_TO_STRING(DATE_value);