LOCALE Function

Sets the locale.

Category: Information and Conversion
Returned data type: String
Notes: The returned value is a string of the current locale setting.
This function affects certain operations such as converting and date operations. This function returns the previous locale. If no parameter is passed, the current locale is returned. The locale setting is a global setting.

Syntax

<string>LOCALE(< >)
<string>LOCALE(<“locale_string”>)

Details

If a parameter is specified, it is set. Otherwise, it is retrieved. If setting, the old locale is retrieved.
The following values can be set in the LOCALE() function:
  • You can use a two-character abbreviation for the US and UK locales
  • A three-character abbreviation can be used for some countries, like GER, FRA, or DEU
Here are some examples:
my_locale = locale("DEU")
my_locale = locale("German")
my_locale = locale("German_Germany")
my_locale = locale("German_Germany.1252")
The LOCALE() function returns the current setting using Country_Language.codepage notations.
Note: If you use ("#iso8601"), the date is set in the ISO8601 format.

Example

string currentSetting
string newSetting
 
currentSetting = locale();
 
newSetting = locale("FRA");