View helper for formatting dates.

 Methods

__construct()

__construct() 

Exceptions

\Zend\I18n\Exception\ExtensionNotLoadedException if ext/intl is not present

Format a date

__invoke(\DateTime | int | array $date, int $dateType, int $timeType, string $locale, string | null $pattern) : string

Parameters

$date

\DateTimeintarray

$dateType

int

$timeType

int

$locale

string

$pattern

stringnull

Returns

string

Get the locale to use

getLocale() : string | null

Returns

stringnull

Get the timezone to use

getTimezone() : string | null

Returns

stringnull

Get the view object

getView() : null | \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::getView()

Returns

Set locale to use instead of the default

setLocale(string $locale) : \Zend\I18n\View\Helper\DateFormat

Parameters

$locale

string

Returns

Set timezone to use instead of the default

setTimezone(string $timezone) : \Zend\I18n\View\Helper\DateFormat

Parameters

$timezone

string

Returns

Set the View object

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\View\Helper\AbstractHelper
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::setView()

Parameters

Returns

 Properties

 

Formatter instances

$formatters : array

 

Locale to use instead of the default

$locale : string

 

Timezone to use

$timezone : string

 

View object instance

$view : \Zend\View\Renderer\RendererInterface
Inherited

inherited_from \Zend\View\Helper\AbstractHelper::$$view