Skip to main content

numberAsMonth

Returns the month name for the input number — e.g. March for 3.

You can pick which language the function uses by specifying a locale in the second parameter.

The default language in US English.

To perform the reverse operation, use the monthAsNumber function.

Parameters

  • MONTH NUMBER (number)

    The input number. This must be an integer between 1 and 12 (inclusive).

  • LOCALE (string)

    Optional. Determines which language the function uses for the output text. All supported locales are included in the parameter dropdown in the Funciton Builder.

    Default: en_US

Examples

ATL in Script

Result

Notes

[[numberAsMonth(1)]]

January

The locale code is en_US (default), so the function returns the name of the first month of the year in English.

[[numberAsMonth(2,'fr_FR')]]

Février

The locale code is fr_FR, so the function returns the name of the second month of the year in French.

[[numberAsMonth(3,'es_ES')]]

Marzo

The locale code is es_ES, so the function returns the name of the third month of the year in Spanish.

[[numberAsMonth(4,'ru_RU')]]

Апреля

The locale is ru_RU, so the function returns the name of the fourth month of the year in Russian.

[[numberAsMonth(5,'zh_CN')]]

五月

The locale is zh_CH, so the function returns the name of the fifth month of the year in Chinese.

Studio automatically capitalizes the first letter of a new sentence — this is why the Result column shows some month names with initial capitalization, even though that isn't the convention in the selected language.

If you use numberAsMonth mid-sentence, you see the correct capitalization applied.

ATL in Script

Result

The French word for [[numberAsMonth(2)]] is [[numberAsMonth(2,'fr_FR')]]

The French word for February is février

Tip

You can turn off automatic capitalization in your project settings. See Settings > Postprocessing.