Click or drag to resize
FormatDateTime

[This is preliminary documentation and is subject to change.]

The FormatDateTime function is used for formatting objects of type datetime into a string

Syntax
FormatDateTime(dateTimeValue, formattingString)

Result type: String.

Parameters

Name

Type

Description

dateTimeValue

DateTime

The DateTime value that should be formatted.

formattingString

String

The String value specifying how the DateTime value should be formatted. The FormatDateTime function uses the .Net function DateTime.ToString(string) to accomplish the formatting so the formattinString follows the same rules as for that function. See external links for more info on the possible values of the formattingString

Returns

Formatted string.

Type: String.

Examples
FormatDateTime(date, "yyMMdd") - date is 06/08/2010 13:45:30

Result: 100608

FormatDateTime(date, "dddd") - date is 06/08/2010 13:45:30

Result: "tirsdag" (full name of day)

FormatDateTime(date, "D") - date is 06/08/2010 13:45:30

Result: 8. juni 2010

See Also