getDateTimeFormatter

[ Function ]

public static getDateTimeFormatter(
    locale: string | undefined,
    timeZone: string | undefined,
    hour12: boolean | undefined,
    type: Localization.FormatType = 'full'
): Intl.DateTimeFormat;

Returns a cached Intl.DateTimeFormat. If no parameter is specified, the current user setting is used.

Parameter

Name

Type

Description

locale

string | undefined

Desired locale

e.g. de-DE

timeZone

string | undefined

Desired time zone
e.g. UTC

hours12

boolean | undefined

Presentation in 12-hour format?

type

Localization.FormatType

Formatting type

Return value

Type

Description

Intl.DateTimeFormat

Returns a cached Intl.DateTimeFormat.

getDateTimeFormatter 1:

Available from version 1.12