Formats a date and time value using a custom format.
Informal Syntax:
FORMAT_DATE_TIME( In, Format )
Formal Syntax:
FORMAT_DATE_TIME( In:=expression, Format:=expression )
Parameter | Type | Description |
---|---|---|
In | ANY_DATE | The input value to convert to a string. |
Format | ANY_STRING | The format pattern to apply to the In value. See Date and Time of Day Format for information on how to create format patterns. |
The function FORMAT_DATE_TIME returns the In parameter formatted using the Format parameter. See Date and Time of Day Format for information on how to create format patterns.
The type of the return value matches the type of the Format parameter. For example if the Format parameter is a STRING, the return value will be a STRING.
Example | Return Value |
---|---|
FORMAT_DATE_TIME( D#2019-03-08, 'yyyy' ) | STRING#'2019' |
FORMAT_DATE_TIME( D#2019-03-08, "yyyy" ) | WSTRING#"2019" |
The function FORMAT_DATE_TIME is an extension to the IEC 61131-3 standard.
To learn about other Conversion Functions.
To learn about date and time pattern strings.
To learn about string literals and the different types of encoding used.
To learn about other IEC 61131-3 Common Elements.
For the meaning of terms used in Fernhill SCADA.