[TYPO3-mvc] format.date not converting from timestamp?

Bastian Waidelich bastian.waidelich at typo3.org
Fri Nov 19 18:18:31 CET 2010


Sy Moen wrote:

> I have typo3 4.5alpha 3 installed... and the ViewHelper for format.date
> (DateViewHelper.php) throws the, "could not be parsed by DateTime
> constructor." error because the $date is a timestamp... which is how it
> is stored in the db...

Hi Sy ;)

Apart from passing a DateTime object you can use all formats from 
http://de3.php.net/manual/de/datetime.formats.php
Unix timestamps have to be prepended with "@"

try:
<f:format.date format="Y-m-d">@{yourTimestamp}</f:format.date>

HTH
Bastian


More information about the TYPO3-project-typo3v4mvc mailing list