Versions Compared

Key

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

...

Only uppercase letters are used in the examples here, but lowercase are supported as well. However, we recommend using lowercase for times because SRP_DateTime uses 'M' for months and 'm' for minutes.

Locale

The The Locale parameter  parameter specifies the specific culture used to help render the final text. Omitting Omitting Locale or  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:

...

locale name.


Examples

Code Block
languagebp
// Create an OI time
Time = SRP_Time("Encode", 3, 7, 43)

// Format a time using the default format and the current locale
Text = SRP_Time("Format", Time)

// Format a time using the long format and the current locale
Text = SRP_Time("Format", Time, "Long")

// Format a time using the long format and the Spanish language
Text = SRP_Time("Format", Time, "Long", "es")

// Format a time using a custom format and the Spanish-MEXICAN language
Text = SRP_Time("Format", Time, "h:mm:ss tt", "es-MX")

...