FormatDate

Prev Next

General

The format function takes a Date-Time value and converts it to a String applying the supplied Format String.

Syntax

You can call the Format function using the following syntax:

Format Functin Syntax

FormatDate(<value>, <format string>, [<culture code>])

The parameters of the function are:

Name

Description
value Date-Time value to format.
format string The Format String to apply.
culture code The code of the culture to use when formatting. If you don't specify this optional parameter, the currently applicable culture will be used; this is either the default culture (which can be configured in the Server Settings or a culture that has been activated using an Activate Culture action.). This needs to be one of the values of the CultureInfo Code column of the  Culture Code List.

For more information about the format strings, see https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings.

Examples

The following expression returns a String that contains the formatted date of today() with the default culture:

FormatDate Function Example

FormatDate(today(), "d")
"01.08.2025"

The following expression returns a String that contains the formatted date of the Datasource variable vToday with the default culture:

FormatDate Function Example

FormatDate([Datasource].[MyDatasource].[Variable].[vToday], "d")
"31.05.2013"

The following expression returns a String that contains the formatted date of the Datasource variable vToday with the default culture:

FormatDate Function Example

FormatDate([Datasource].[MyDatasource].[Variable].[vToday], "D")
"Freitag, 31. Mai 2013"

The following expression returns a String that contains the formatted date of the Datasource variable vToday with the culture en-US:

FormatDate Function Example

FormatDate([Datasource].[MyDatasource].[Variable].[vToday], "d", "en-US")
"5/31/2013"

In the above examples, the default culture is de-AT.

Available in version 3.5.20 and higher.