An Expression Designer function that returns a string expression based on the time, time format, and locale specified by the user.
local variable = FormatTime(Time, Format, Locale)
The FormatTime 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 time string is interpreted and displayed in the output of the FormatTime 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 FormatTime function returns the current system time using the system time format and locale of the operating system:
FormatTime ("Current","Default", "Default")
The following examples show how to use the elements of the Format parameter to customize the output of the FormatTime function:
FormatTime("9:05:08 PM", "hh:mm:ss tt", "en-US") returns "09:05:08 PM" FormatTime("9:05:08 PM", "HH:mm:ss", "en-US") returns "21:05:08" FormatTime("9:05:08 PM", "tt", "Default") returns "PM"
The following example shows how to use the Locale parameter to affect the output for English (United States) and English (United Kingdom) locales:
FormatTime("14:30", "Default", "en-US") returns "2:30:00 PM" FormatTime("14:30", "Default", "en-GB") returns "14:30:00"