Since: 8.1

class IntlDatePatternGenerator (View source)

Methods

__construct(string|null $locale = null)

Creates a new IntlDatePatternGenerator instance

create(string|null $locale = null)

Creates a new IntlDatePatternGenerator instance

string|false
getBestPattern(string $skeleton)

Determines the most suitable date/time format

Details

__construct(string|null $locale = null)

Creates a new IntlDatePatternGenerator instance

Parameters

string|null $locale

The locale. If null is passed, uses the ini setting intl.default_locale.

static IntlDatePatternGenerator|null create(string|null $locale = null)

Creates a new IntlDatePatternGenerator instance

Parameters

string|null $locale

The locale. If null is passed, uses the ini setting intl.default_locale.

Return Value

IntlDatePatternGenerator|null

Returns an IntlDatePatternGenerator instance on success, or null on failure.

string|false getBestPattern(string $skeleton)

Determines the most suitable date/time format

Determines which date/time format is most suitable for a particular locale.

Parameters

string $skeleton

The skeleton.

Return Value

string|false

Returns an ICU date/time pattern accepted by IntlDateFormatter on success, or false on failure.