Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Locale parameter specifies the specific culture used to help render the final text. Omitting Locale or setting it "" causes the "Format" service to use the user's current Windows locale setting. If, however, you want to specify your own localization, set this parameter to a locale name. Locale names have a complex syntax that allow you to specify all manner of aspects, but in 99.99% of cases, you'll use the format "language-REGION". Here, language is a lowercase ISO 639-1 language code. REGION specifies an uppercase ISO 3166-1 country/region identifier. The region is optional. For example, the locale name for English is "en", the locale name for English (United States) is "en-US", and the locale name for Divehi (Maldives) is "dv-MV".

Here is a chart for the 200 most common languages and regions:

...

Examples

Code Block
languagebp
// Create an OI date
Date = SRP_Date("Encode", 2020, 1, 14)

// Format a date using the default format and the current locale
Text = SRP_Date("Format", Date)

// Format a date using the long format and the current locale
Text = SRP_Date("Format", Date, "Long")

// Format a date using the long format and the Spanish language
Text = SRP_Date("Format", Date, "Long", "es")

// Format a date using a custom format and the Spanish-MEXICAN language
Text = SRP_Date("Format", Date, "MMMM D, YYYY", "es-MX")

...