Page History
...
Locale | Short Format | Long Format |
---|---|---|
en-US | 1/14/2020 | Tuesday, January 14, 2020 |
es-ES | 14/01/2020 | martes, 14 de enero de 2020 |
fr-FR | 14/01/2020 | mardi 14 janvier 2020 |
If you omit Format or set it to "", then "Short" will be used.
...
Here are some example date formats, all them for the date January 114, 20062020:
Format | en-US | es-ES | fr-FR |
---|---|---|---|
MMMM D, YYYY | January 14, 2020 | enero 14, 2020 | janvier 14, 2020 |
DDDD, MMM DD, YYYY | Sunday, Jan 01, 2006 | martes, ene. 14, 2020 | mardi, janv. 14, 2020 |
M/D/YY | 1/14/20 | 1/14/20 | 1/14/20 |
YYYY-MM-DD | 2020-01-14 | 2020-01-14 | 2020-01-14 |
"Happy New Year! It's" MMMM DD! | Happy New Year! It's January 14! | Happy New Year! It's enero 14! | Happy New Year! It's janvier 14! |
...
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 | ||
---|---|---|
| ||
// 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") |
...