View helper for formatting dates.

package Default
inherited_from \Zend\View\Helper\AbstractHelper

 Methods

__construct()

__construct() 

Exceptions

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

Format a date

__invoke(\DateTime|integer|array $date, integer $dateType = \IntlDateFormatter::NONE, integer $timeType = \IntlDateFormatter::NONE, string $locale = null, string|null $pattern = null) : string

Parameters

$date

\DateTimeintegerarray

$dateType

integer

$timeType

integer

$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\HelperInterface::getView()

Returns

null\Zend\View\Renderer\RendererInterface

Set locale to use instead of the default

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

Parameters

$locale

string

Returns

\Zend\I18n\View\Helper\DateFormat

Set timezone to use instead of the default

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

Parameters

$timezone

string

Returns

\Zend\I18n\View\Helper\DateFormat

Set the View object

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

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\Helper\AbstractHelper

 Properties

 

Formatter instances

$formatters : array

Default

array()
 

Locale to use instead of the default

$locale : string

Default

 

Timezone to use

$timezone : string

Default

 

View object instance

$view : \Zend\View\Renderer\RendererInterface

Default

null