Spork Code Libraries

Date

Render a DateTime object as a formated string

Extends
\Zend\View\Helper\AbstractHelper
Implements

Properties

$formats

$formats : array

Predefined formats

Type

array

Methods

__invoke()

__invoke(\DateTimeInterface  $datetime, string  $format = 'medium') 

Render a DateTime object as a formated string.

Parameters

\DateTimeInterface $datetime
string $format

createService()

createService(\Zend\ServiceManager\ServiceLocatorInterface  $serviceLocator) 

Create and configure instance

Parameters

\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
See also

setFormat()

setFormat(string  $name, string  $format) 

Set a datetime format

Parameters

string $name
string $format

getFormat()

getFormat(string  $name) : string

Get a datetime format

Parameters

string $name

Returns

string

setFormats()

setFormats(array  $formats) 

Set a list of datetime formats

Parameters

array $formats

addFormats()

addFormats(array  $formats) 

Add datetime formats

Parameters

array $formats

getFormats()

getFormats() : array

Get datetime formats

Returns

array

normalize()

normalize(  $datetime) 

Parameters

$datetime