# Locale()

### The function `locale()` lets you change the locale used to translate dates. For example, Americans write 12/1/2006 to denote December 1, while in England the same date is written 1/12/2006.

### The action

`locale(“en_GB”)`

### sets the current locale to “British English”. Locale codes begin with a two-letter language code, followed by and underscore and a two-letter region code. These are ISO standards ISO-639 and ISO-3166 respectively. Code combinations are available for any language supported by Mac OS X.

### To return to the user’s preferred locale, use

> `locale();`

### You may also save the old locale in an attribute for subsequent use. For example:

`$OldLocale=local(“en_GB”);`

### … do various things ...

`local($OldLocale);`

### Note that changing the locale() can be fairly time-consuming, as lots of machinery must be torn down and rebuilt for each change.