Class DateFormat

Summary

Fully Qualified Name: Laminas\I18n\View\Helper\DateFormat
Extends: AbstractHelper

Description

View helper for formatting dates.

Methods

Name Description Defined By
__construct() DateFormat
__invoke() Format a date DateFormat
getLocale() Get the locale to use DateFormat
getTimezone() Get the timezone to use DateFormat
getView() Get the view object AbstractHelper
setLocale() Set locale to use instead of the default DateFormat
setTimezone() Set timezone to use instead of the default DateFormat
setView() Set the View object AbstractHelper

Method Details

__construct()

Returns:

__invoke()

Format a date

Parameter Name Type Description
$date \DateTimeInterface|\IntlCalendar|int|array
$dateType int
$timeType int
$locale string|null
$pattern string|null

Returns: string

getLocale()

Get the locale to use

Returns: string

getTimezone()

Get the timezone to use

Returns: string

getView()

Get the view object

Returns: null|\Renderer

setLocale()

Set locale to use instead of the default

Parameter Name Type Description
$locale string

Returns: $this

setTimezone()

Set timezone to use instead of the default

Parameter Name Type Description
$timezone string

Returns: $this

setView()

Set the View object

Parameter Name Type Description
$view \Renderer

Returns: \AbstractHelper

Top