ViewHelper Documentation

Formats a \DateTime object.

= Examples =

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

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

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

< format="d.m.Y - H:i:s">+1 week 2 days 4 hours 2 seconds</> 13.12.1980 - 21:03:42 (depending on the current time, see

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

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

{ dateObject)} 1980-12-13 (depending on the value of {dateObject})

{dateObject ->} 1980-12-13 (depending on the value of {dateObject})


date anySimpleType

either a DateTime object 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 (a DateTime object or a string) used if $date is a relative date specification. Defaults to current time.

ViewHelper Resources

Schema Resources