Package

ViewHelpers

ViewHelper Documentation

format.date

Formats an object implementing \DateTimeInterface.

= Examples =

<f:format.date>{dateObject}</f:format.date> 1980-12-13 (depending on the current date)

<f:format.date format="H:i">{dateObject}</f:format.date> 01:23 (depending on the current time)

<f:format.date format="Y" base="{dateObject}">-1 year</f:format.date> 2016 (assuming dateObject is in 2017)

<f:format.date format="d.m.Y - H:i:s">+1 week 2 days 4 hours 2 seconds</f:format.date> 13.12.1980 - 21:03:42 (depending on the current time, see http://www.php.net/manual/en/function.strtotime.php)

<f:format.date format="%d. %B %Y">{dateObject}</f:format.date>

  1. Dezember 1980 (depending on the current date and defined locale. In the example you see the 1980-12-13 in a german locale)

{f:format.date(date: dateObject)} 1980-12-13 (depending on the value of {dateObject})

{dateObject -> f:format.date()} 1980-12-13 (depending on the value of {dateObject})

Arguments

date anySimpleType

Either an object implementing DateTimeInterface or a string that is accepted by DateTime constructor

format string

Format String which is taken to format the Date/Time

base anySimpleType

A base time (an object implementing DateTimeInterface or a string) used if $date is a relative date specification. Defaults to current time.

ViewHelper Resources

Schema Resources