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

Xavier Perseguers typo3 at perseguers.ch
Fri Nov 19 19:12:47 CET 2010


Hi,

>> 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>

And then enjoy the problem of timezone problem as already reported 
because unix timestamp does not have a timezone whereas DateTime has :-)

Xavier


More information about the TYPO3-project-typo3v4mvc mailing list