FORMAT_DATE_TIME

Help Contents

Introduction

Formats a date and time value using a custom format.

Syntax

Informal Syntax:

FORMAT_DATE_TIME( In, Format )

Formal Syntax:

FORMAT_DATE_TIME( In:=expression, Format:=expression )

Parameters

ParameterTypeDescription
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.

Return Value

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.

Examples

ExampleReturn Value
FORMAT_DATE_TIME( D#2019-03-08, 'yyyy' )STRING#'2019'
FORMAT_DATE_TIME( D#2019-03-08, "yyyy" )WSTRING#"2019"

Standards Compliance

The function FORMAT_DATE_TIME is an extension to the IEC 61131-3 standard.

Further Information

Conversion Functions

To learn about other Conversion Functions.

Data and Time of Day Format

To learn about date and time pattern strings.

String Literals

To learn about string literals and the different types of encoding used.

Common Elements

To learn about other IEC 61131-3 Common Elements.

Glossary

For the meaning of terms used in Fernhill SCADA.