Skip to main content

get_format

For a specific format type, return the format for the current language (locale). Default to the format in the settings. format_type is the name of the format, e.g. 'DATE_FORMAT'. If use_l10n is provided and is not None, it forces the value to be localized (or not), otherwise it's always localized.

def get_format(
format_type: string,
lang: string = None,
use_l10n: boolean = None
) - > string|list

For a specific format type, return the format for the current language (locale). Default to the format in the settings.

Parameters

NameTypeDescription
format_typestringThe name of the format to retrieve, such as 'DATE_FORMAT' or 'DATETIME_FORMAT'.
langstring = NoneThe language code used to look up the localized format; defaults to the current active language if not provided.
use_l10nboolean = NoneA flag to force localization on or off; if None, localization is enabled by default.

Returns

TypeDescription
`stringlist`