An Expression Designer function that returns a string expression based on the date, date format, and locale specified by the user.
local variable = FormatDate (Date, Format, Locale)
The FormatDate function syntax has the following parameters:
In general terms, a locale defines the user's language, country and any special variant preferences, such as the formats used for dates and times, that the user wants to see in their user interface.
The Locale parameter applies a specified locale definition for how a date string is interpreted and displayed in the output of the FormatDate function. Values for this parameter are based on Windows operating system locale names. An example of a locale name for French (Canada) is "fr-CA". For a list of supported locales, refer to the "Locale Identifier Constants and Strings" topic in Microsoft's National Language Support Reference.
All parameters are required. To use the default value of the Format or Locale parameter, enter "Default" in the expression. In the following example, the FormatDate function returns the current system date using the system date format and locale of the operating system:
FormatDate("Current", "Default", "Default")
The following examples show how to use the elements of the Format parameter to customize the output of the FormatDate function:
FormatDate("Jan 9, 2009", "dddd, MMM-dd-yyyy", "Default") returns "Friday, Jan-09-2009" FormatDate("Jan 9, 2009", "d/M/yy", "Default") returns "9/1/09" FormatDate("Jan 9, 2009", "yy", "Default") returns "09"
The following example is run on an English operating system and shows how to use the Locale parameter to convert a French locale date to a Spanish locale date. This is a two step process in which you convert a non-numeric French date (2009 janvier 9) to a numeric French date (2009-01-09) format. In the second step, you convert the numeric date to a Spanish date (2009-enero-09):
FormatDate("2009 janvier 9", "yyyy-MM-dd", "fr-FR") returns "2009-01-09" FormatDate(FrNumericDate, "yyyy-MMMM-dd", "es-ES") returns "2009-enero-09"