DATEVALUE ER function

The DATEVALUE function returns a Date value that is converted from a given text value in the specified format and in an optionally specified culture to a date value. For information about the supported formats, see standard and custom.

Syntax 1

DATEVALUE (text, format)

Syntax 2

DATEVALUE (text, format, culture)

Arguments

text: String

Text that represents the value to format.

format: String

The format of the given text. For information about the supported formats, see standard and custom.

culture: String

The culture that is used for formatting of the given text. For information about the supported cultures, see culture.

Return values

Date

The resulting date value.

Usage notes

When the culture isn't defined as an argument of the called function, the value of culture is defined by the calling context. For example, if the DATEVALUE function is called by using syntax 1 in an Electronic reporting (ER) format for a FILE element that is configured to use the German culture, the conversion will be done by using the German culture. The default culture value is EN-US.

Example 1

DATEVALUE ("21-Dec-2016", "dd-MMM-yyyy") returns the date value December 21, 2016, based on the specified custom format and the default application's EN-US culture.

Example 2

DATEVALUE ("21-Gen-2016", "dd-MMM-yyyy", "IT") returns the date value January 21, 2016, based on the specified custom format and culture.

However, DATEVALUE ("21-Gen-2016", "dd-MMM-yyyy", "EN-US") throws an exception to inform the user that the specified string isn't recognized as a valid date for the specified culture.

Additional resources

Date and time functions